Introduction
BuddyBoss does not provide a built-in setting to hide the login error message “A username and password must be provided. Lost your password?”. This message is part of WordPress’ default login system. You can hide it using a small custom function added to your active theme. This guide explains how you can hide “A username and password must be provided. Lost your password?” from the sign-in page.
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 (?>):
function bb_hide_msg_on_login_css() {
echo '<style type="text/css">
div#login_error {
display: none;
}
</style>';
}
add_action('login_enqueue_scripts', 'bb_hide_msg_on_login_css');- Click Update File to save the changes.
After applying this code, the login error message will no longer appear on the sign-in page.
Troubleshooting and FAQs
Q: The message is still visible after adding the code.
A: Ensure the code is added to your child theme’s functions.php file, not the parent theme. Clear your site cache and refresh the login page.
Q: Will this prevent users from logging in?
A: No. Users can still log in, but they won’t see the error message if they enter incorrect credentials.