Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save thagxt/11121283 to your computer and use it in GitHub Desktop.
Save thagxt/11121283 to your computer and use it in GitHub Desktop.
Change default e-mail address and name on outgoing e-mails sent by WordPress.
<?php
// Change default e-mail address and name on outgoing e-mails sent by WordPress.
// code goes in your theme functions.php
// New Email
function sb_new_mail_from( $email ) {
$email = 'info@yoursite.com'; // change
return $email;
}
add_filter( 'wp_mail_from', 'sb_new_mail_from' );
// New Name
function sb_new_mail_from_name( $name ) {
$name = 'Your Website Name'; // change
return $name;
}
add_filter( 'wp_mail_from_name', 'sb_new_mail_from_name' );
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment