Change WordPress Email “Send From” Settings

Change WordPress Email “Send From” Settings

By default, your WordPress installation sends user registration emails from “[email protected]” For example, if your blog is at, emails will come from [email protected]

Not good enough for me

If my real email address is [email protected] or [email protected], I want my WordPress emails “branded” with my real email address. The Change WP eMail From Details plugin is quick and easy to setup and does exactly what we want.

See the end of this post for a simple functions.php alternative, which is my preferred method because the Change WP eMail plugin isn’t from the WP Plugin Directory, and there are more files in the plugin’s folder than I would have expected necessary to achieve this functionality, plus some warnings from the Plugin Check plugin. I did verify both methods accomplish the stated goal – to customize the “from” email name and address.


The blank plugin settings screen, after initial installation:

The plugin settings screen with options filled out (courtesy of plugin’s webpage):

Notice the check boxes; they control the plugin’s operation.

WordPress Email Settings

To be clear, the General Settings email address is used for receiving administrator emails, not the setting for outgoing emails.

The functions.php code

This is something you’d probably want out of your theme’s functions.php file and into a “functions plugin”. The code is the same, but use the plugin mentioned above (without these snippets), or use a functions plugin instead of your theme’s functions.php file.

Change the email address

Here are 2 functions.php snippets (use one or the other) to change the “from email address”:

Option 1

{code type=php}/* enter the full email address you want displayed */
/* from */
function xyz_filter_wp_mail_from($email){
return “[email protected]”;
add_filter(“wp_mail_from”, “xyz_filter_wp_mail_from”);

Option 2 (functionality not available in the plugin)

I like this one because it’s easier to add to new websites. I don’t want to accidentally use “[email protected]” and then copy/paste to my client at and have their emails look like they’re coming from’s site. If you put “[email protected]” in this code, it’s basically duplicating what WordPress already does by default. So maybe use “[email protected]” and make sure that’s an address that your users can reply to. Or use “[email protected]” to discourage reply emails.

{code type=php}/* auto-detect the server so you only have to enter the front/from half of the email address, including the @ sign */
function xyz_filter_wp_mail_from($email){
/* start of code lifted from wordpress core, at */
$sitename = strtolower( $_SERVER[‘SERVER_NAME’] );
if ( substr( $sitename, 0, 4 ) == ‘www.’ ) {
$sitename = substr( $sitename, 4 );
/* end of code lifted from wordpress core */
$myfront = “[email protected]”;
$myback = $sitename;
$myfrom = $myfront . $myback;
return $myfrom;
add_filter(“wp_mail_from”, “xyz_filter_wp_mail_from”);

Change the Name

Here’s the snippet for changing the “from email name”:

{code type=php}/* enter the full name you want displayed alongside the email address */
/* from */
function xyz_filter_wp_mail_from_name($from_name){
return “Best Name Ever”;
add_filter(“wp_mail_from_name”, “xyz_filter_wp_mail_from_name”);


Your email recipients (like new member registrations and post edit notifications) will see your plugin’s settings in action.

From “name” and “address” are highlighted by the red outlines

It’s as simple as that. Feel free to share your own experiences below.

Free Video Why 100 is NOT a Perfect Google PageSpeed Score (*5 Min Watch) Learn how to use Google PageSpeed Insights to set realistic goals, improve site speed, and why aiming for a perfect 100 is the WRONG goal.