# Friendlier Password Reset Email

> Replaces the wording of the password reset email with a clearer message and subject, keeping the reset link intact.

- Type: PHP
- Runs: Run everywhere
- Category: [Email](https://wpide.com/library/category/email/)
- Tags: email, password, users
- Author: WPIDE Team
- Installs: 0
- Updated: 2026-10-28
- Page: https://wpide.com/library/email-custom-password-reset/

## Code

```php
add_filter( 'retrieve_password_title', function () {
    return sprintf( 'Reset your %s password', wp_specialchars_decode( get_bloginfo( 'name' ), ENT_QUOTES ) );
} );

add_filter( 'retrieve_password_message', function ( $message, $key, $user_login, $user ) {
    $url = network_site_url( 'wp-login.php?action=rp&key=' . $key . '&login=' . rawurlencode( $user_login ), 'login' );

    return sprintf( "Hi %s,\n\n", $user->display_name ? $user->display_name : $user_login )
        . "We received a request to reset the password for your account.\n\n"
        . "Choose a new password here:\n" . $url . "\n\n"
        . "If you did not ask for this, you can ignore this email and your password will stay the same.\n";
}, 10, 4 );
```

## Notes

The reset link expires after 24 hours by default.

## How to use it

Install the free WPIDE plugin (https://wordpress.org/plugins/wpide/), find "Friendlier Password Reset Email" in its snippet library and add it in one click; or create a new PHP snippet in WPIDE (or any code snippets plugin) and paste the code above. More snippets: https://wpide.com/library/
