How to Hide Child Forums or Sub-Forums from the Main Forum Page in BBPress

how to hide child forums subforums from home page bbpress
Share the knowledge

It seems to be insanely difficult to find out how to hide subforums or child forums from the main forum page in BBPress, even though it seems like such a simple and obvious thing to want to do. As it turns out, how to hide subforums is simple, it’s just not obvious.

First, to show you what we mean, here’s a live example.

The website at DadsRights.org recently launched a set of fathers rights forums. One section of their forums is the state-by-state listings, meaning that they have 50 subforums in that section (one for each state). Out of the box, this is how the forums home page looks with this set of subforums:

how to hide subforums child forums bbpress

Pretty cluttered, right? You can see why they may have wanted to tidy that up a bit.

The Internet Patrol is completely free, and reader-supported. Your tips via CashApp, Venmo, or Paypal are appreciated! Receipts will come from ISIPP.

CashApp us Square Cash app link

Venmo us Venmo link

Paypal us Paypal link

In fact, what DadsRights.org wanted was to make it look like this:

how to hide child forums subforums from home page bbpress

 

Now, doesn’t that look better?

And, when someone clicks on the “State by State Information” forum, what they see is:

subforums child forums hidden from main forum page

 

Perfect!

Now, how to do this?

As you may have discovered, if you searched Google or other Internet search sites for this information, there isn’t much out there, and what is out there tells you that you need to change and fiddle with the line <?php if (bb_forums()); ? >.

But it’s actually much simpler than that. At least it is for some WordPress / BBPress installs – we can’t promise that this easy fix will work for all combinations of WordPress, BBPress, and various themes.

Instead of editing the line <?php if (bb_forums());? >, do this:

Go to your /plugins/bbpress directory.

Now go to the /templates/default/bbpress/ subdirectory.

There you will see the loop-single-forum.php file.

Make a backup of the loop-single-forum.php file!

Really, make the backup! Don’t say that we didn’t warn you!

Now, edit the loop-single-forum.php file, and find the line with <?php bbp_list_forums(); ?>.

We found it on line number 44:

bbp_list_forums on line 44

 

Now, simply delete that line, save the file, and you’ll find that the subforum list is completely gone from your forum home page, with the added advantage that when you click on the forum to get to the subforums, the list of subforums is nice and neat!

subforums child forums hidden from main forum page

Get New Internet Patrol Articles by Email!

The Internet Patrol is completely free, and reader-supported. Your tips via CashApp, Venmo, or Paypal are appreciated! Receipts will come from ISIPP.

CashApp us Square Cash app link

Venmo us Venmo link

Paypal us Paypal link

 


Share the knowledge

One thought on “How to Hide Child Forums or Sub-Forums from the Main Forum Page in BBPress

  1. Hi,

    this css trick is even easier way to hide subforums :)

    #bbpress-forums .bbp-forums-list {
    display: none;
    }

Leave a Reply

Your email address will not be published. Required fields are marked *

This site is protected by reCAPTCHA and the Google Privacy Policy and Terms of Service apply.