How to Change the Default Email of WordPress Sites?

By default, emails sent out from a WordPress website (e.g. upon user registration, etc.) will have the sender “WordPress <[email protected]>”. This does not look professional. However, WordPress does not provide an easy way to amend it in the admin area.

One will need to add the following code in the functions.php of the theme to change the default email address:


// amend the from email address
if ( !function_exists('amend_wp_mail_from') ) {
   function amend_wp_mail_from($email){
      return [email protected]';  // replace [email protected] with your email
   }
   add_filter("wp_mail_from", "amend_wp_mail_from");
}
// amend the from name
if ( !function_exists('amend_wp_mail_from_name') ) {
   function amend_wp_mail_from_name($from_name){
      return "new-name";  // replace new-name with your preferred name
   }
   add_filter("wp_mail_from_name", "amend_wp_mail_from_name");
}

0

Comments


Please login to post comments.

Login thru Twitter / Facebook

 

Log in with Facebook