0

When a user loses their password in WordPress, you are prompted to enter your email or username.

When the password reset email has been sent, it displays "wordpress" as a sender name. I want my website or blogname to replace that instead.

I would rather send my own personal email and link to the users my self, without sending anyone to the WP login page. On my website I have my own login page, and putting a lost password link there would fit me a lot better.

How can I have the "lost password" email that are sent to the users, display my blog name as the sender name, instead of "wordpress"?

Is it possible to have my own emails sent to the users that I can link to my login page thats on my site, not on the Wordpress login page?

2

If you have a custom login page already, you may not want to introduce a whole new plugin. You can change 'from' name and email with these simple functions in your theme or plugin.

To change the name

add_filter( 'wp_mail_from_name', 'custom_wpse_mail_from_name' );
function custom_wpse_mail_from_name( $original_email_from ) {
    return 'Yours Truly';
}

To change the email

add_filter( 'wp_mail_from', 'custom_wpse_mail_from' );
function custom_wpse_mail_from( $original_email_address ) {
    return 'me@wpse.com';
}

If you want to use the same email address everywhere, you can simply set that in the general settings and change the name only. If you want to change it for just the password recovery, there are resets for the above functions that will return in to it's default settings. It's all in the codex. Here are a couple links to get you in the right direction:

https://codex.wordpress.org/Plugin_API/Filter_Reference/wp_mail_from_name

https://codex.wordpress.org/Plugin_API/Filter_Reference/wp_mail_from

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.