retrieve_password_message filter-hookWP 2.8.0

Filters the message body of the password reset mail.

If the filtered message is empty, the password reset email will not be sent.


add_filter( 'retrieve_password_message', 'wp_kama_retrieve_password_message_filter', 10, 4 );

 * Function for `retrieve_password_message` filter-hook.
 * @param string  $message    Email message.
 * @param string  $key        The activation key.
 * @param string  $user_login The username for the user.
 * @param WP_User $user_data  WP_User object.
 * @return string
function wp_kama_retrieve_password_message_filter( $message, $key, $user_login, $user_data ){

	// filter...
	return $message;
Email message.
The activation key.
The username for the user.
WP_User object.


Since 2.8.0 Introduced.
Since 4.1.0 Added $user_login and $user_data parameters.

Where the hook is called

wp-includes/user.php 3217
$message = apply_filters( 'retrieve_password_message', $message, $key, $user_login, $user_data );

Where the hook is used in WordPress

Usage not found.