WP for Wordpress

How to change the WordPress default email From name and address



You are probably  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.

you can easily change it by adding a filter to  your themes functions.php file



wp_mail_from_name for name and  wp_mail_from to change the from email

/** changing default wordpres email settings */
 
add_filter('wp_mail_from', 'tr_mail_from');
add_filter('wp_mail_from_name', 'tr_mail_from_name');
 
function tr_mail_from($old) {
 return 'your email address';
}
function tr_mail_from_name($old) {
 return 'your name or your website';
}
 

Now, save functions.php file and upload.

These filters will simply override default WordPress email settings.


Responses

0 Respones to "How to change the WordPress default email From name and address"

Post a Comment

AddThis

 

Recent Comments

Return to top of page Copyright © 2014