When WordPress sends automated emails, such as notifications or password resets, the default sender name is often set to “WordPress.” This can appear impersonal and may confuse your users, leading them to ignore or delete the emails. By changing the sender name and email address to match your brand, you can make your emails look more professional and recognizable.
In this guide, I’ll show you how to change the sender name in outgoing WordPress emails using two different methods: adding a code snippet to your theme’s functions.php
file or using a plugin.
Why Change the Sender Name?
Customizing the sender name helps reinforce your brand identity and ensures that your users know the emails are from a trusted source. This not only increases the chances of your emails being opened but also reduces the likelihood of them being marked as spam.
Step-by-Step Guide to Change the Sender Name
1. Using a Code Snippet
If you’re comfortable working with code, you can modify the sender name and email address by adding a few lines of code to your theme’s functions.php
file.
Here’s how to do it:
// Function to change the sender name function custom_sender_name($original_email_from) { return 'Your Website Name'; } add_filter('wp_mail_from_name', 'custom_sender_name'); // Function to change the sender email address function custom_sender_email($original_email_address) { return '[email protected]'; } add_filter('wp_mail_from', 'custom_sender_email');
Explanation:
- The above code utilizes the
wp_mail_from_name
andwp_mail_from
filters to customize both the sender name and email address. - Replace
'Your Website Name'
and'[email protected]'
with your desired name and email address.
Important Note: Make sure to back up your functions.php
file before making any changes to avoid breaking your site.
2. Using a Plugin
If editing code isn’t your thing, you can use a plugin to change the sender name and email address. This approach is beginner-friendly and allows you to easily customize your email settings.
Recommended Plugin: WP Mail SMTP
WP Mail SMTP is a popular plugin that not only lets you configure SMTP for your WordPress emails but also provides options to change the sender name and address.
How to Use WP Mail SMTP:
- Install and activate the WP Mail SMTP plugin.
- Go to WP Mail SMTP settings in your WordPress dashboard.
- Under the General tab, enter your desired sender name and email address.
- Save your changes.
The plugin also allows you to test your email configurations by sending a test email under the Email Test tab.
3. Testing Your Changes
After applying your changes, it’s crucial to send a test email to ensure everything is working correctly.
- For the code snippet method: You can create a test email by calling the
wp_mail()
function in a custom plugin or theme file. - For the WP Mail SMTP plugin: Go to the Email Test tab and send a test email to verify that the new sender name and email address are displayed correctly.
Best Practices for Setting Sender Name and Email
- Use a Professional Email Address: Consider using an address that matches your domain, such as
[email protected]
. This improves your email deliverability and brand consistency. - Avoid Common Spam Triggers: Make sure the sender name and email are clearly related to your brand to prevent your emails from being marked as spam.
By following this guide, you can customize the sender name and email address for your outgoing WordPress emails, making your messages more personalized and enhancing your brand’s presence.