Get Admin Email Address From External PHP page

Basically what you’re looking to do is create a separate page within a WordPress site that (I’m sort of guessing here) you’re not creating within WordPress itself, but you want to pull WordPress data.

There’s a “cheater” method and an officially sanctioned method to do what you want.

The “cheater” method is to call wp-load.php from your separate PHP file. This will load the WP database stuff and give you access to WP functions. Many people think this is easier, but I do not recommend it because it can cause problems in certain setups.

The official way to do it is to go from within WordPress itself. Specifically, by hooking the template_redirect action you can redirect any URL you like to whatever PHP file you want — while still having access to WP because you’re running from within WP.

Then use get_userdata() to fetch the User’s email address.