Back to Top

How to change default FROM name and email address in WordPress

Generally, To change default From name and default From Email Address in notifications mail send to the users, most of the people go for the plugin but If your aim is to change simply this address, there is no need of the plugin because if you want to do this yourself, it’s quite simple without use of plugin.

Sometimes what happened you use the plugin but that plugin is not updated from 2 years so it might not work with the latest version of WordPress or you upgrade plugin and break your site. So It is better to solve such things without plugin.

By default, WordPress uses the from name WordPress and address [email protected] when it sends notifications to the user which is not very meaningful because sometimes notifications are flagged as junk or spam mail. It isn’t convenient and you might want to change both of things so you can customize both these fields with below post so your users are not confused.

You also like:

To get Current URL in WordPress
To use Pagination with Taxonomy in WordPress
Share user Data in multiple WordPress Installation

This post will show you how to do this just with some simple code.In WordPress, You can also customize registration and profile page by adding requires fields.

Just Simply Go to the Appearance >> Editor menu in the WP Admin Panel, then find functions.php in the list of theme files on the right. Add these filters in your functions.php file of your theme

How To Filter the email address

To change the email address add a filter on ‘wp_mail_from’ like

add_filter ('wp_mail_from', 'sender_from_email');
function sender_from_email ($old) {
	return'[email protected]'; // Replace it with your desired address
}

How To Filter the email name

you can also change the sender’s name using the ‘wp_mail_from_name’ filter.

add_filter ('wp_mail_from_name', 'sender_from_name');
function sender_from_name ($old) {
	return'Your From Name'; // Replace it with your desired name
}

From now, when sends notifications, you can see the from address replaced with above name and address and seems like: Your From Name < [email protected] >. To Change WordPress default email from name and address is simple and it’s useful.

Also, After doing changes, it is better to test by sending email in WordPress.Testing in WordPress is easy.If you facing any issue,Let me know in comment section. Mostly likely it will be some coding issue.

Comments (1)

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.

Most Popular Posts

Steps To speed up Eclipse IDE

Posted on 6 years ago

Bhumi

The Readers’ Poll – June 2012

Posted on 7 years ago

Bhumi

Sliding Thumbnail and Caption with jQuery

Posted on 7 years ago

Bhumi

The Reader’s Poll – June 2015

Posted on 4 years ago

Bhumi

The Reader’s Poll – August 2014

Posted on 4 years ago

Bhumi

The Reader’s Poll – June 2014

Posted on 5 years ago

Bhumi

The Readers’ Poll – May 2014

Posted on 5 years ago

Bhumi

The Readers’ Poll – August 2013

Posted on 5 years ago

Bhumi