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

Digital wallet app development cost in Singapore: customer scanning a QR code with a smartphone to pay at a shop counter

Digital Wallet App Development Cost in Singapore (2026)

A wallet payment in Singapore only feels instant because a lot happens behind the tap: the user was verified before…

Shafeeq Khan
November 29, 2026
Colour photograph illustrating the Eoxys blog post 'Brand Mentions for AI Search: Earn Citations Off Your Site', used as the featured image for brand mentions ai search.

Brand Mentions for AI Search: Earn Citations Off Your Site

When someone asks an AI assistant “which company should I use for X?”, the answer is rarely built from your…

Shafeeq Khan
November 29, 2026
E-commerce marketplace app development cost in India: shopper on a sofa using a phone beside colourful shopping bags

E-commerce Marketplace App Development Cost in India (2026)

A marketplace order in India only works when three parties agree: the buyer pays by UPI or card, the seller…

Shafeeq Khan
November 28, 2026
,

Leave a Reply

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