Nodejs and NPM have made life so easier. If you use Gulp toolkit with it I am sure you love it 😍 However, I came...
How to change default email sender in WordPress
Fahid JavidI get several requests for “How to change default email sender in WordPress” to the desired ones while providing tech support for the WordPress themes.
It’s very annoying when someone gets important contact form emails as spam or simply don’t like the email address of the type wordpress@yourdomain.com (in my example it would be wordpress@fahidjavid.com) and the sender’s name would be set to “WordPress”.
Fortunately, there’s a simple way of changing this:
- Go to your WordPress administration panel
- Select Appearance > Editor
- On the right-hand side of your screen, you’ll see a list of WordPress files. Locate functions.php and open it.
- At the end of the file, copy and paste the following code, replacing username@email.com and Your Name or Your Website with the ones you want.
- Press Save and you’re done.
add_filter('wp_mail_from', 'new_mail_from');
add_filter('wp_mail_from_name', 'new_mail_from_name');
function new_mail_from($old)
{
return 'username@email.com';
}
function new_mail_from_name($old)
{
return 'Your Name or Your Website';
}
Feel free to post in comments if you face any issue to make it work.