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