In this article you will learn how to change the default from email address for WordPress. One of the main reasons to change the default email address that WordPress uses to send out emails is for reliability and integrity.
Method 1: WP Change Default From Email Plugin
If you don’t feel like writing a custom code function, then WP Change Default From Email plugin is for you. Once this plugin has been installed, a settings page will be available to easily change the from email address or from name value. These settings can be found inside your WordPress dashboard under “Settings” -> “Change From Email”. Simply update the relevant fields accordingly.
Method 2: Custom Code For Developers
If you are new to WordPress development, be sure that you work through our guide on The Right Way To Customize WordPress. This method requires you to work with code and we recommend that if you are working with code to have SFTP or host file management access to your website.
Simply add the code below to your custom WordPress plugin. Change the values accordingly, we recommend in using a person’s name from the business such as the owner or someone in a similar role. This helps your customers relate to the email or reply directly to default WordPress emails.
You do not have to use the add_filter( 'wp_mail_from_name', 'change_my_sender_name' );
if you want to keep the from sender name as per default. We thought we’d add this in since we are already changing the default from email address for WordPress.
You can test this by adding a new user, changing your password, or any other action that will send a WordPress notification email.
Hopefully this article has given both user’s and developers a solution to a very common problem and will help for future projects or plugins.
Photo by Nick Cooper on Unsplash
Hello Andrew, is it a good article with a nice tip. You have mentioned a good way t change the default from email id. I think the second technique of customizing the WordPress Code is a better way to change this as it can help you to reduce the plugin loads on your website. I personally think that we should lower plugin use whenever we need to do little tasks as we can do it with custom code so that it can help our website to load faster.
The amount of plugins can sometimes slow down a site. I prefer recommending either Code Snippets (plugin) or a custom plugin that is solely used for customizations for a website as a lot of sites don’t use child themes, this adds one plugin with organized code for customizations to a site. Thanks for leaving a comment, if you are using a child theme you can add the code to the functions.php file too! 🙂