Change Sender Name And Email in Outgoing WordPress Email.

Code

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');

Related reading:

Shiv Kumawat

Executive Director & CEO

Shiv Kumawat is the CEO of Eoxys IT Solution LLP, a Jaipur-based IT and GenAI development company he has led since 2009. Eoxys has delivered 700+ projects, building custom AI agents, chatbots, mobile apps and web platforms for businesses worldwide. Shiv writes about practical AI app development and what it takes to ship software that works.

Latest Posts

Isometric illustration of a business hiring a remote AI development team in India, with a laptop showing an AI chip linked across a globe to developer workstations

Hire AI Developers in India: Models, Vetting and Red Flags

If you plan to hire AI developers in India, the hard part is not finding people. It is telling a…

Shiv Kumawat
October 11, 2026
DPDP compliance for AI apps: isometric shield protecting a phone and cloud server, with consent toggle, padlock and data cubes on a navy background

DPDP Compliance for AI Apps: What to Fix Before May 2027

If your app or AI chatbot handles personal data of people in India, DPDP compliance for AI apps is now…

Shiv Kumawat
October 10, 2026
GPT-6.1 Sol vs Claude Sonnet 5.5: isometric illustration of two AI model cubes connected by a data stream on a navy background

GPT-6.1 Sol vs Claude Sonnet 5.5: Which Model for Your App?

GPT-6.1 Sol vs Claude Sonnet 5.5 is the mid-tier choice most founders are making right now. Both models launched in…

Shiv Kumawat
October 9, 2026
,

Leave a Reply

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