I have taken over a project that has a customized password reset email. I've searched through all the text in project for this email but cannot find it. I suspect it might be in a .po file or something, but perhaps someone can direct me faster.

1 Answer 1


WordPress uses custom wp_mail function, so you won't find it, if you'll search for mail.You should find retrieve_password_message filter call there. This is the filter that returns the content of reset password message.

// Change the message/body of the email
add_filter( 'retrieve_password_message', 'rv_new_retrieve_password_message', 10, 4 );
function rv_new_retrieve_password_message( $message, $key, $user_login, $user_data ){
     *  Assemble the URL for resetting the password
     *  see line 330 of wp-login.php for parameters
    $reset_url = add_query_arg( array(
        'action' => 'rp',
        'key' => $key,
        'login' => rawurlencode( $user_login )
    ), wp_login_url() );

    printf( '<p>%s</p>', __( 'Hi, ' ) . $user_fname );
    printf( '<p>%s</p>', __( 'It looks like you need to reset your password on the site. If this is correct, simply click the link below. If you were not the one responsible for this request, ignore this email and nothing will happen.' ) );
    printf( '<p><a href="%s">%s</a></p>', $reset_url, __( 'Reset Your Password' ) );

    $message = ob_get_clean();
    return $message;

In wp-login,You can find function that retrieve password.

177  * Handles sending password retrieval email to user.
178  *
179  * @uses $wpdb WordPress Database object
180  *
181  * @return bool|WP_Error True: when finish. WP_Error on error
182  */
183 function retrieve_password() {}

I advice you please do not edit core files of WordPress use hook/filter in function.php file.I hope this will help you.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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