1. Home
  2. Knowledge Base
  3. Customizations
  4. PHP Functions
  5. How to Customize the “Reset your Password” Email Template

How to Customize the “Reset your Password” Email Template

Introduction

By default, the “Reset your password” email is sent using WordPress core functionality. BuddyBoss does not provide a built-in option to customize this email. However, you can change the subject line and email message body by adding custom code to your active theme. This guide explains how you can customize the “Reset your Password” email template.

Custom Workaround

Before proceeding, make sure you have a complete site backup.

  1. Go to Appearance > Theme File Editor in your WordPress admin dashboard.
  2. Under Select theme to edit, choose your active theme (preferably a BuddyBoss Child Theme), then click Select.
  3. From the Theme Files list, open Theme Functions (functions.php).
  4. Add the following code 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;
}
?>

Important: Customize the subject and message body text as needed for your site.

  1. Click Update File to save the changes.

Note: Modifications are typically considered custom work, but we are making an exception in this case. Please review the BuddyBoss Support Policy.

Troubleshooting and FAQs

Q: The email content is not updating.
A: Make sure the code is added to your child theme’s functions.php file, not the parent theme. Clear any caching plugins that might affect email output.

Q: Can I customize the email further?
A: Yes. You can modify the $message variable to include additional information, HTML formatting (if you switch to HTML emails), or branding elements.

Q: Will this affect other emails?
A: No. This only affects the password reset email. Other BuddyBoss or WordPress emails remain unchanged.

Q: Can I revert this change easily?
A: Yes. Remove or comment out the added code in functions.php and save the file.

Was this article helpful?

Related Articles

Subscribe to Our Newsletter

Stay In Touch

Subscribe to our Newsletter, and we’ll send you the latest news from BuddyBoss

  • This field is hidden when viewing the form
  • This field is for validation purposes and should be left unchanged.

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

  • Get Started

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

  • This field is for validation purposes and should be left unchanged.