Change Sender Name And Email in Outgoing WordPress Email.

Code

Change Sender Name And Email in Outgoing WordPress Email.

How to change default sender name and email in outgoing WordPress email?

This can be done by many plugins but the real reason behind doing this using custom code is that Using too many plugins can harm your website or blog speed and performance which is not desirable by any site owner. that’s why we use custom code in most of the cases if the issue is not bigger like to change sender email and name is outgoing WordPress email.

By default, when we sends an email notification it uses ‘WordPress’ as the sender name. This looks unprofessional and we can change it to a real person or your website title.

Plugin like, Woocommerce give option in admin back-end to set email subject and send from email. but if we send our custom email it will take default ‘WordPress’ as the sender name. so we need to change this.

So to add custom code, first move to your WordPress theme function.php and use two wordpress hook.

  • 'wp_mail_from'
  • 'wp_mail_from_name'

We can easily change that by adding this code to our theme’s functions file.

For Changing mail from email.

// Function to change email address
function ChangeSenderEmail( $email ) {
    return '[email protected]';
}
add_filter('wp_mail_from','ChangeSenderEmail');

For Changing mail from Name.

// Function to change sender name
function ChangeSenderEmailName( $name) {
     return 'Xyz Scott';
}
add_filter('wp_mail_from_name','ChangeSenderEmailName');

For Changing mail from Name only when from Name is default ‘WordPress’.

Some plugin like Woocommerce as we discuss , modify send from name ,so if we want to modify name only if it’s not already modified then we need to use “if” conditional statement .

// Function to change sender name
function ChangeSenderEmailName($name){
  if($name	==	'WordPress'){
    return 'Xyz Scott';
  }else{
    return $name;
  }
} 
add_filter('wp_mail_from_name','ChangeSenderEmailName');

Shiv kumawat

Executive Director & CEO

"Shiv kumawat is the Executive Director and CEO of Eoxys It Solution LLP and the strategic mind behind the company"s growth. His expertise in operational efficiency and team leadership empowers his colleagues to excel and innovate.”

Latest Posts

Smarter Learning for a Smarter Era: How AI Is Transforming Learning Management Systems (LMS) in 2025

  Smarter Learning for a Smarter Era: How AI IsTransforming Learning Management Systems(LMS) in 2025 From Static Systems to Intelligent…

Shafeeq Khan
October 3, 2025

AI Overviews and Google Search: What Businesses Need to Know in 2025

  AI Overviews and Google Search: What Businesses Need to Know in 2025 Entering the Age of AI Overviews The…

Shafeeq Khan
September 23, 2025

Ride Smarter: How AI Is Transforming Cab Apps in the USA for 2025

  Ride Smarter: How AI Is Transforming Cab Apps in the USA for 2025 The New Pulse of Urban Travel…

Shafeeq Khan
September 20, 2025
,

Leave a Reply

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