Sarathlal N

Change default sender name and email of WordPress notifications

In default, WordPress use WordPress@your_website.com as the sender email and WordPress as sender name for all email notifications like forget password, new registrations etc. But in customized WordPress installations, I like to use custom name and email address for all notifications from my application.

So instead of using plugins, I’m going to use a simple code snippet for this WordPress tweaks. So here is a small code snippet to change sender email address and sender name of WordPress notifications.

add_filter('wp_mail_from', 'new_mail_from');
add_filter('wp_mail_from_name', 'new_mail_from_name');
 
function new_mail_from() {
	return 'yourname@yourdomain.com';
}
function new_mail_from_name() {
	return 'Your Name';
}

We want to add above code snippet in our theme’s functions.php file and then change the details. That’s done.

Looking for a skilled WordPress/WooCommerce developer? I'm currently available for freelance, contract, or full-time remote opportunities! Let's create something amazing together. Send me a quick message, and I'll respond within 24 hours!

Recent Posts

  1. Understanding the Singleton Pattern and Using Traits to Achieve Singleton in WordPress Plugin Development
  2. REST API Methods Explained with Best Practices for Building Clean and Secure APIs
  3. My 28-Day Plan to Master Modern WordPress Development Using AI Tools
  4. Scaling WordPress - How Custom Database Tables Solve the Post Meta Bottleneck
  5. WordPress Transients Explained - A Developer's Guide to Site Performance

Your Questions / Comments

If you found this article interesting, found errors, or just want to discuss about it, please get in touch.