WordPress – How to change the ‘From’ address for password reset and notification emails

When WordPress sends emails it should use the email address set in the Settings -> General -> ‘E-mail Address’ field.


However, I’ve seen cases where it hasn’t used this address and has instead used an address associated with the host, such as the cpanel email address.

If you’re having troubles getting WordPress to use your address or display name you can use the following code.

Simply copy it into your theme’s functions.php file and change as required.

add_filter('wp_mail_from', 'itsg_mail_from_address');
public function itsg_mail_from_address($email){
return '[email protected]';
add_filter('wp_mail_from_name', 'itsg_mail_from_name');
function itsg_mail_from_name($from_name){
return "Senders Name";

Related Articles

Leave a Reply

Your email address will not be published.