In BuddyBoss, forums associated with groups (Group Forums) are still shown in the Forums Directory by default—even if you’ve chosen to hide the groups themselves.
If you want to hide group-associated forums from the Forums Directory, you can do this easily with a small code snippet using the bbp_before_has_forums_parse_args filter.
✅ The Solution
Add the following code to your theme’s functions.php file or a custom plugin:
/**$args['meta_query'][] = array(
* Exclude group forums from the directory.
*
* @param array $args The arguments to modify.
*
* @return array The modified arguments.
*/
function bb_custom_exclude_group_forums_from_directory_args( $args ) {
if ( function_exists( 'bbp_is_forum_archive' ) && bbp_is_forum_archive() ) {
// Exclude forums associated with groups.
'relation' => 'OR',
array(
'key' => '_bbp_group_ids',
'compare' => 'NOT EXISTS',
),
array(
'key' => '_bbp_group_ids',
'value' => '',
'compare' => '=',
),
array(
'key' => '_bbp_group_ids',
'value' => 'a:0:{}',
'compare' => '=',
),
);
}
return $args;
}
add_filter( 'bbp_before_has_forums_parse_args', 'bb_custom_exclude_group_forums_from_directory_args' );
🧠 How It Works
- Checks if we’re on the Forums Directory page.
- Adds a
meta_queryto exclude forums that have the_bbp_group_idsmeta key, which links them to a group.
✅ Result
Only standalone forums (not connected to any group) will appear in the Forums Directory.
