How to change the default from wordpress email from address

June 27, 2012    custom wordpress wordpress email from

Sometimes you might want to stop Wordpress sending emails with the default Wordpress email from address.

Usually something like wordpress@domain.com

Often displayed like so: Wordpress wordpress@domain.com

There are a few plugins available to achieve this, but personally I don't relying heavily on Wordpress plugins - mainly because dependencies on too many third parties can be annoying.

Particularly when there is not much code needed to achieve the change.

Add the following code to your functions.php file.

add_filter('wp_mail_from', 'replacement_mail_from');
add_filter('wp_mail_from_name', 'replacement_mail_from_name');
 
function replacement_mail_from($old) {
 return 'your email address';
}
function replacement_mail_from_name($old) {
 return 'your name or your website';
}

blog comments powered by Disqus