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, the Jaipur-based IT company he has led since 2009. An AI & IT Solutions Consultant with 16+ years of experience, he works with startups and enterprises to turn ideas into market-ready SaaS platforms, mobile apps and AI-driven solutions. His team has delivered 700+ projects across SaaS, mobile and web apps, automation and AI. He previously served as Chief Technology Officer for a US company.

Latest Posts

AI agent approach illustration: an AI agent on a platform connected to tools, email, browser and a completed task

Hire an AI Agent Developer: Skills, Cost and When You Need One

An AI agent is software that uses a language model to decide what to do next: look something up, call…

Shafeeq Khan
October 31, 2026
AI visibility audit illustration: a rising search visibility chart, an eye symbol and ranked podium blocks

AI Visibility Tools Compared: Prices, Engines and Limits

If you want to know whether ChatGPT, Gemini or Google’s AI Overviews mention your business, you have two choices: check…

Shafeeq Khan
October 30, 2026
RAG vs fine-tuning illustration: an AI model drawing on a knowledge base of documents on an isometric navy platform

Build an AI Chatbot With Your Own Data: RAG Explained for Business

Most teams that want to build an AI chatbot with your own data have the same problem: a general chatbot…

Shafeeq Khan
October 29, 2026
,

Leave a Reply

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