1. Home
  2. Knowledge Base
  3. Customizations
  4. PHP Functions
  5. How to Disable the Group Tab in the User Profile for Logged-out Users

How to Disable the Group Tab in the User Profile for Logged-out Users

Introduction

The Groups tab in a BuddyBoss user profile is visible to all visitors, including logged-out users. If you want to limit profile navigation and prevent logged-out users from accessing the Groups tab, you can do so by adding a small custom function to your active theme. This tutorial walks you through how to disable the Group tab in the user profile for logged-out users.

Custom Workaround

Note: Any modifications are considered custom work. Please review the BuddyBoss Support Policy before proceeding.

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

  1. Go to Appearance > Theme Editor in your WordPress admin dashboard.
  2. Under Select theme to edit, choose your active theme (preferably 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_remove_groups_tab_for_visitors() {
    if ( is_user_logged_in() ) {
        return;
    }
    bp_core_remove_nav_item( 'groups' );
}
add_action( 'bp_ready', 'bb_remove_groups_tab_for_visitors' );
  1. Click Update File to save your changes.

Once applied, the Groups tab will no longer appear in user profiles when viewed by logged-out visitors.

Screenshots

Logged in:

A computer screen displays a user profile page on a social platform called Lavis BuddyBoss The profile features the username laranz a circular animal avatar and a purple abstract banner Tabs and profile details are visible

Logged out:

A computer screen displays a profile page for the user learanz on a website The background is beige with orange and purple circles The profile page shows a purple header image and a circular animal avatar

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 Groups tab is still visible for logged-out users.
A: Make sure the code is added to the active theme’s functions.php file and clear any site or browser cache. Also confirm that no other custom code or plugin is re-adding the Groups tab.

Q: Will this hide the Groups tab for logged-in users as well?
A: No. Logged-in users will continue to see the Groups tab normally.

Q: Does this prevent logged-out users from accessing groups entirely?
A: No. This only removes the Groups tab from the user profile navigation. Group visibility still depends on your site’s privacy and access settings.

Q: How can I revert this change?
A: Simply remove the added code from 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.