Select Page

WordPress by default uses this address wordpress@yourdomain.com which quite often ends up in user’s spam mail folder. It is strange why WordPress has not provided any option on the settings page to change the default from email name and address. But they have provided some filters that we can use to change this information.

Here is a simple fix for this problem. Just add this code to your themes functions.php and make changes according to your needs.

/**
 * Change default FROM email name and address
 */

add_filter('wp_mail_from', 'custom_wp_mail_from');
add_filter('wp_mail_from_name', 'custom_wp_mail_from_name');

function custom_wp_mail_from($old) {
	return 'Sender Name <user@domainname.com>';
}
function custom_wp_mail_from_name($old) {
	return 'Sender Name';
}

 

Learn more about these filters

 

Also there is a simple plugin available to perform the same task. It is very handy for people who dont want to get their hands dirty with the code 😀

Change WordPress default email address and name