1. Home
  2. Knowledge Base
  3. Customizations
  4. PHP Functions
  5. How to Force Password Field Masking on the Reset Password Page

How to Force Password Field Masking on the Reset Password Page

Introduction

BuddyBoss does not provide a built-in option to force password masking on the Reset Password page. You can ensure the password field is always hidden (masked) by adding a small custom function to your active theme. This guide explains how to force password field masking on the reset password page.

Custom Workaround

  1. Go to Appearance > Theme 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, click Theme Functions (functions.php).
  4. Paste the following code just before the closing PHP tag (?>):
function bb_hook_enqueue_scripts() { ?>
    <script>
        document.addEventListener("DOMContentLoaded", (event) => {
            setTimeout(() => {
                document.getElementById('pass1').type = 'password';
            }, 200);
        });
    </script>
<?php }
add_action( 'login_enqueue_scripts', 'bb_hook_enqueue_scripts', 1 );
  1. Click Update File to save your changes.

After implementing this code, the password field on the reset password page will always appear masked, enhancing security for users entering new passwords.

Screenshots

Without Code:

Screenshot of a BuddyBoss reset password page The left side shows the BuddyBoss logo and text Sell memberships courses and build online communities The right side displays password reset fields and blue action buttons


With Code:

Screenshot of a BuddyBoss login page with the option to reset a password The left side promotes BuddyBoss features while the right side displays fields to enter and save a new password along with language settings at the bottom

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 password field is still showing in plain text.
A: Make sure the element ID is pass1 (WordPress default). If you are using a custom template, inspect the password field to verify the ID and update the code accordingly.

Q: Will this affect other login pages?
A: No. This script only targets the password field on the reset password page.

Q: How can I remove this behavior later?
A: Remove the code from functions.php and save the file.

Q: Who can I contact for assistance if this doesn’t work?
A: Please review the BuddyBoss Support Policy or consult a developer for custom troubleshooting.

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.