/*Reverse sticky header*/
  1. Home
  2. Knowledge Base
  3. Customizations
  4. PHP Functions
  5. Customizing “Reset your password” Email Template

Customizing “Reset your password” Email Template

The “Reset your password” email template actually comes from the WordPress core. If you wish to change the content of this email template, you’ll need to use custom code in the functions.php file of your child theme.

Kindly note that modifications are typically considered custom work, but we are making an exception in this case. Kindly check our Support Policy here: https://www.buddyboss.com/support-policy/.

Kindly try adding the following code in your theme files:

1. Go to Appearance > Theme File Editor

2. Under “Select theme to edit”, choose (BuddyBoss Child/Whatever theme is active), then click “Select”.

3. Below Theme Files, select Theme Functions (functions.php).

4. Append the following just before the closing PHP tag “?>”:

<?php // Customize the subject of the reset password email add_filter( 'retrieve_password_title', 'custom_reset_password_subject' ); function custom_reset_password_subject( $title ) { // Custom subject $title = 'Your Custom Subject for Password Reset'; return $title; } // Customize the message body of the reset password email add_filter( 'retrieve_password_message', 'custom_reset_password_message', 10, 4 ); function custom_reset_password_message( $message, $key, $user_login, $user_data ) { // Create a custom password reset link $reset_link = network_site_url( "wp-login.php?action=rp&key=$key&login=" . rawurlencode( $user_login ), 'login' ); // Custom message body $message = "Hi " . $user_data->display_name . ",\n\n"; $message .= "It seems like you've requested a password reset for your account on " . get_bloginfo( 'name' ) . ".\n\n"; $message .= "To reset your password, please click the link below:\n"; $message .= $reset_link . "\n\n"; $message .= "If you did not request this change, please ignore this email.\n\n"; $message .= "Thank you,\n"; $message .= get_bloginfo( 'name' ) . " Team"; return $message; } ?>

NOTE: Please make a backup of your site.

5. Click “Update File”.

Was this article helpful?

Related Articles

Need Support?

Can't find the answer you're looking for?
Contact Support

To speak to our Agency consultant, fill in the form found at our Contact Page.

"*" indicates required fields

Get Started

Enter your name and email address to get started with your project...

Name*