How to Get Email Address of Site Administrator

This is a tiny code snippet which retrieves Site Administrators email address. To access admin’s email address, we are going to use get_bloginfo() function.

Quick Tip : How to Add Page Slug in Body Class of your WordPress

<?php
echo get_bloginfo('admin_email');
?>

You can also use get_option function, to do the same.

<?php
echo get_option('admin_email');
?>

 

 

2 Comments

  1. Hi-

    I am trying to reach a Site Administrator and do not understand how you use the .php above to accomplish this. If I had access to the php in the site then that would not be good for that site.

    Is there a way to accomplish this via other route? I have heard that the XML (without doc tree) can have the email address in it as being found on a line beginning <buffer

    You thoughts?

    Reply
    • Hey Jenny, Thanks for the comment.

      You can use this code to retrieve the administrator’s email address for your own website which is assigned via Settings=>General=>E-mail Address. If you need to access admin’s email address while building a WordPress theme or plugin, you can extract it dynamically using following code instead of hardcoding it.

      Reply

Leave a Comment.