
How to Change WordPress Default Email Sender ID
- March 10, 2016
- Leave a comment
Being a WordPress site owner, you might get email notifications/alerts when somebody submitted a remark/comment or a user joined or did anything that required that WordPress send an Email.
This email by default utilized a really non-specific address (email ID) i.e. “wordpress@your-domain.com??? as a part of the “from sender??? bar. You can change the from email address with your desired address using wp_mail_from filter.
This filter will modify the “from email address” used in an email sent using the wp_mail function by adding the following code:
1 |
<!--?php add_filter( 'wp_mail_from', 'pt_wp_mail_from' ); function pt_wp_mail_from( $email_address ) { //Make sure the email is from the same domain //as your website to avoid being marked as spam. return ‘abc@mydomainname.com'; } ?--> |
User Comments