This website uses cookies so that we can provide you with the best user experience possible. Cookie information is stored in your browser and performs functions such as recognising you when you return to our website and helping our team to understand which sections of the website you find most interesting and useful.
Change the from name and from email in WordPress
This is a classic, and therefore deserves a short post: changing the name and address of the sender in WordPress email sends.
By default, WordPress will use something like WordPress wordpress@example.com.
If you want to change it, and improve the user experience a little more, then I’ll show you how to do it, it’s very easy.
To change the address:
add_filter( 'wp_mail_from', 'change_mail_from', 10, 1 );
function change_mail_from( $old ) {
return 'no-reply@example.com';
}
To change the name:
add_filter( 'wp_mail_from_name', 'change_mail_from_name', 10, 1 );
function change_mail_from_name( $old ) {
return 'My Site';
}
Ready, with this you can change these parameters.
Remember, a good place to put these snippets is in the functions.php of your theme or child theme.