How to change WordPress default email From name and address

You are probably reading this post because have already noticed, that every time someone submitted a comment on your blog, signed up as a user or did anything that required WordPress to generate and send an e-mail, by default the “From Name” in that message appeared as “WordPress” and “From” address was “wordpress@your-domain.com”.

If this is not the way you want it – read on, as there is an easy way of customizing both these fields.

So how can you change these WordPress default email settings for FromName and From address.

So far I found three ways of doing it:

a) you can install a WordPress plugin, for example: Change WP eMail from Tips & Tricks HQ;

b) edit wp-includes/pluggable.php file, look for lines 372-396, and make changes in:

375 |   $from_name = ‘WordPress’;
change ‘WordPress’ to ‘your name or your website’

391 | $from_email = ‘wordpress@’ . $sitename;
change ‘wordpress@’ to ‘your name@’

Remember the email address you are changing this to must exist either as a mailbox or a forward.

c) add filter to functions.php file

The third option is my favourite and comes from Deluxe Blog Tips. I prefer to keep all my tweaks in one functions.php file as later I can easily reuse them on another project.

So how do we do this.

First of all you need to find and open functions.php file – it should be in your template folder.

Open it and either at the beginning or the end (as you prefer) – paste the following code:
/** changing default wordpres email settings */

add_filter(‘wp_mail_from’, ‘new_mail_from’);
add_filter(‘wp_mail_from_name’, ‘new_mail_from_name’);

function new_mail_from($old) {
return ‘your email address’;
}
function new_mail_from_name($old) {
return ‘your name or your website’;
}
Obviously you have to replace ‘your email address’ with your actual address, and ‘your name or your website’ with the name that you want to appear as FromName on all messages.

Now, aave file and upload.

These filters will simply override default WordPress email settings.
I hope one of these three solutions worked for you, share and enjoy.

  1. Hello there, You’ve done a fantastic job. I will definitely digg it and personally recommend to my friends.
    I’m sure they will be benefited from this site.

  2. Hi this is kinda of off topic but I was wondering if blogs use WYSIWYG editors or if you have to manually code with
    HTML. I’m starting a blog soon but have no coding know-how so I wanted to get guidance from someone with experience.

    Any help would be greatly appreciated!

  3. I blog quite often and I truly appreciate your content. This article
    has truly peaked my interest. I will bookmark your site and keep checking for new details about once a week.
    I subscribed to your RSS feed as well.

  4. yYvL0KAXQ says:

    407553 798586This internet internet site is normally a walk-through its the data you wished about this and didn

  5. Hello, I enjoy reading through your article. I like to
    write a little comment to support you.

  6. We are a group of volunteers and opening a new scheme in our community.
    Your site offered us with valuable info to work on. You’ve done an impressive job and our entire community will be grateful to you.

  7. Hmm is anyone else encountering problems with the pictures on this blog loading?

    I’m trying to determine if its a problem on my end or if it’s
    the blog. Any feedback would be greatly appreciated.

  8. terance says:

    Hi.
    Very-very nice topic which you share on this internet. I became so happy after reading this topic.
    I want to make website like this so can you tell me cost of this website and revert back on my emial id.

  9. Finn says:

    Outstanding post however I was wanting to know if you
    could write a litte more on this topic? I’d be very thankful if you
    could elaborate a little bit further. Thanks!

  1. By Homepage on August 10, 2014 at 12:07 pm

    … [Trackback]

    […] Informations on that Topic: indianitgroup.com/how-to-change-wordpress-default-email-from-name-and-address/ […]

*