DISCLAIMER: this post is older than one year and may not be up to date with latest WordPress version.

WordPress is a very flexible blogging platform, but by default, you can’t modify the FROM email adress. If you want to be able to easily change it, just read the recipe I have for you today.

Simply paste the following snippet into your functions.php file. Don’t forget to put the desired email adress on line 5 and desired name on line 8.

add_filter('wp_mail_from', 'new_mail_from');
add_filter('wp_mail_from_name', 'new_mail_from_name');

function new_mail_from($old) {
 return 'admin@yourdomain.com';
function new_mail_from_name($old) {
 return 'Your Blog Name';

Credits: Rainy Day Media.



  1. u know, the wordpress would send you email when there are new comments on your blog, do u know how to change the format of the email content? not only the email address

  2. This works great…. except when I receive the email and hit ‘reply’ it sends to the admin email and not the one I put in function:
    function new_mail_from($old) {
    return ‘admin@yourdomain.com’;
    I think it is because it only changes the From: and not the Reply-To: headers in the email. I am guessing there is not hook filter for Reply-To since that may open up spoofing and spamming stuff??

  3. As an alternative to this method, I recommend the SB Welcome Email Editor – http://wordpress.org/extend/plugins/welcome-email-editor/

    The Reasons:

    The plugin does not automatically change the email address for ALL other plugins.

    For example – If you use Contact Form 7 (http://wordpress.org/extend/plugins/contact-form-7/) or another contact form plugin, the method above will change all “From” fields set in the contact form settings to the default email address and name set in the functions.php and ignore the email address and from name set in the contact form.

  4. Ok… so functions.php. uh… where would that be located? I don’t see it in my wp file structure.

  5. @sylvia, functions.php is located in your theme directory something like this ../wp-content/themes/nameOfYourTheme/functions.php

  6. Perfect, thanks for this.

Leave a Comment

Your email address will not be published. Required fields are marked *