Though WordPress comes with packed features it is not always the case that you can change everything from the frontend. Especially email related setup in WordPress needs lot of time and effort to understand and troubleshoot. In most of the cases it is also difficult to judge whether you have a problem on your installation or that’s the way WordPress works.
Receiving Emails from WordPress User
One such an issue is receiving emails from the username called “WordPress”. For example, you might have enabled email notifications for new comments or comments waiting for moderation under “Settings > Discussion” section. This will send an email to administrator whenever users post new comments. However, this email will come from the sender username as “WordPress” from the email id “[email protected]“.
The problem here is even the external users registering for your site or subscribed to comment or blog notifications will also receive emails from the sender username “WordPress”. This may not be professional especially when you need to send lot of email notifications to users.
Changing WordPress Sender Name in Emails
Unfortunately there are no frontend solutions you can do this from admin dashboard. Nevertheless there are multiple solutions to fix the issue using one of the following ways.
1. Using a Plugin
WordPress has plugin for everything and you can also change the sender email address in emails with a plugin.
- First, download the Change WP Email plugin to do the trick for you. Though this is a free plugin it can only be downloaded from the external site and not available in WordPress plugin repository.
- Go to your WordPress admin panel and navigate to “Plugins > Add New” section.
- Click on “Upload Plugin” button and then upload the plugin’s ZIP file by clicking on “Choose File” button.
- Click “Install Now” button and then activate the plugin.
- Navigate to “Settings > Change Email Details” section.
- Select “Customize the From Name” and “Customize the From Address” checkboxes and provide your details in the corresponding text boxes.
- Click “Update Options” button to save the changes.
You will start receiving emails as per the customized details provided instead of default “WordPress” username.
2. Modify functions.php File
The second option is to modify your theme’s functions.php file to add some filters as below:
/** Change Default WordPress Username on Emails */
add_filter('wp_mail_from', 'new_mail_from');
add_filter('wp_mail_from_name', 'new_mail_from_name');
function new_mail_from($old) {
return 'your email';
}
function new_mail_from_name($old) {
return 'your site name';
}
Replace “your email” and “your site name” with your own values. Ensure to use proper single quotes and add the code at the end of functions.php file. Next time onwards the emails sent from WordPress will have your own name. This method also has a drawback that the changes will be lost whenever you update your theme. You can overcome this by using a child theme and adding the function under child theme’s file or use plugins like Code Snippets to add new functions to your site.
3. Change pluggable.php File
The last option is to modify WordPress core pluggable.php file available under “/wp-includes/” folder in order to change the email sender name. You can edit the file using FTP account or File Manager app in your hosting account. The folder will be available under the root directory of your WordPress installation. Modify the below codes in the file to suitable name for your site:
- $from_name = ‘WordPress’; – Change the name “WordPress” with your own user name.
- $from_email = ‘wordpress@’ . $sitename; – Change “wordpress” and “sitename” parameters with your own user name and site name respectively.
The issue here is that the changes will be lost whenever you update WordPress to next version. You need to remember this and change the php file every time after update. Also, pluggable.php file is depreciated in recent WordPress versions and the file will be removed soon or later. Therefore, we recommend using one of the above methods to change sender email.
Points to Note
Generally the sender username in email notifications is “WordPress” for most of the hosting companies. However, on certain shared hosting plans you may receive the emails with the username of shared server. You can use one of the above methods to change sender email for this case also. If that does not work, get in touch with your hosting company to use the default WordPress settings. Another consideration is for those using WooCommerce plugin. In this case, you have an option under “WooCommerce > Settings” section to change from email and address of sender.
In addition, do not confuse this topic with changing default admin username or email in WordPress.
Final Words
We strongly recommend changing the default WordPress sender name and email with custom values. This will help when your customers and members receiving emails from a professionally looking email address and sender name. Though you can use any of the explained method for this purpose, using plugin is a simple and safer way. Let us know which method worked for you in the comments below.
2 Comments
Leave your reply.