Are you looking for a way to change the from address in your WordPress theme? While there’s probably a plugin for this, we have created a quick code snippet that you can use to change wp_mail_from
in WordPress.
Instructions:
All you have to do is add this code to your theme’s functions.php file or in a site-specific plugin:
add_filter('wp_mail_from','from_mail'); function from_mail($content_type) { return '[email protected]'; }
Note: If this is your first time adding code snippets in WordPress, then please refer to our guide on how to properly add code snippets in WordPress, so you don’t accidentally break your site.
If you liked this code snippet, please consider checking out our other articles on the site like: 24 best WordPress education themes and how to create stunning WordPress optin forms.
How to delete an address of the sender into email wordpress
Too late for John, but if anyone comes across this again, to change the name the mail comes from, the filter is wp_mail_from_name. So something like:
add_filter(‘wp_mail_from_name’,’from_mail_name’);
function from_mail_name($content_type) {
return ‘My Business Name’;
}
Clever, thanks.
But the name of the email is still WordPress, any idea how to change that as well?
function mail-name or something …
[…] This post was mentioned on Twitter by HTMLfrp, WPSNIPP. WPSNIPP said: #wordpress Change wp_mail_from wordpress http://bit.ly/gBG5VY #blog please RT 🙂 […]