How to Change Sender Name & Email Address in WordPress Email
You will need to add the following code in your theme’s functions.php file. Please keep in mind, for the manual additions to functions.php on the main theme folder can be lost after any theme upgrades. Therefore, we suggest you to use a child theme always, and add the custom codes in child theme’s function.php file.
1
2
3
4
5
6
7
8
9
10
11
12
13
14
|
// Function to change email address function wpb_sender_email( $original_email_address ) { return 'jdoe@yourdomain.com' ; } // Function to change sender name function wpb_sender_name( $original_email_from ) { return 'John Doe' ; } // Hooking up our functions to WordPress filters add_filter( 'wp_mail_from' , 'wpb_sender_email' ); add_filter( 'wp_mail_from_name' , 'wpb_sender_name' ); |
Why You Should Change the Default Sender Information in WordPress?
The default WordPress sender name is ‘WordPress’ which sends emails from a non-existent email address (wordpress@yourdomain.com) as the sender email.
Many spam filters block your WordPress emails believing it to be spam. Sometimes it does not even make it to the spam folder.
Leave a reply
You must login or register to add a new comment .