Deluxe Blog Tips About Projects

Change WordPress Default Email From Name And Address

Change WordPress Default Email From Name And Address

By default, WordPress uses the from name "WordPress" and address "[email protected]" when it sends notifications to users. It isn't convenient and you might want to change it into your Blog name or something like that. This tutorial will show you how to do this just with some simple code.

Open the functions.php file of your theme and paste the following code into it:

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

function new_mail_from($old) {
 return '[email protected]';
}
function new_mail_from_name($old) {
 return 'Your Blog Name';
}

Change the email address and from name to anything you want, then save file.

From now, when sends notifications (for example, when new user registers), you can see the from address looks like: Your Blog Name <[email protected]>.

Changing WordPress default email from name and address is simple, but it's useful. I wonder why WordPress doesn't use the default admin's information to do that. Hope in the future, WordPress will make it easy to adjust these information. But for now, you can use this small hack for this purpose.