# Hoe onderdruk ik een subcategorie zodat deze niet verschijnt in de categorielijst?

**URL:** https://meta.discourse.org/t/how-do-i-suppress-a-subcategory-from-appearing-on-the-category-list/172178
**Category:** Development
**Created:** [3 december 2020 om 22:43 UTC](https://meta.discourse.org/t/how-do-i-suppress-a-subcategory-from-appearing-on-the-category-list/172178 "2020-12-03T22:43:08Z")
**Posts on this page:** 18
**Page:** 1

<div class="post-metadata">

### Author: ![Monte\_Kalisch](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/monte_kalisch/32/175020_2.png) [@Monte\_Kalisch](https://meta.discourse.org/u/Monte_Kalisch)
#### Post date: [3 december 2020 om 22:43 UTC](https://meta.discourse.org/t/how-do-i-suppress-a-subcategory-from-appearing-on-the-category-list/172178/1 "2020-12-03T22:43:08Z")

</div>

I can’t figure out how to get a subcategory (“Build your own teen innovation challenge” in this case) to stop showing up (the arrow) on the [main category page](https://community.pactful.org/). I’ve tried several things. Can you help?

 ![community](https://global.discourse-cdn.com/meta/original/3X/b/4/b4518a90d3f3950ae90f2b62939ab3a2bf176d6d.png)

---

<div class="post-metadata">

### Author: ![Jonathan5](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/jonathan5/32/197134_2.png) [@Jonathan5](https://meta.discourse.org/u/Jonathan5)
#### Post date: [3 december 2020 om 23:08 UTC](https://meta.discourse.org/t/how-do-i-suppress-a-subcategory-from-appearing-on-the-category-list/172178/2 "2020-12-03T23:08:17Z")

</div>

I can’t find a site setting for this but you could hide it using CSS in a theme component.

---

<div class="post-metadata">

### Author: ![manuel](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/manuel/32/468169_2.png) [@manuel](https://meta.discourse.org/u/manuel)
#### Post date: [3 december 2020 om 23:25 UTC](https://meta.discourse.org/t/how-do-i-suppress-a-subcategory-from-appearing-on-the-category-list/172178/3 "2020-12-03T23:25:34Z")

</div>

Could use this CSS:

```plaintext
.category .subcategories {
      display: none;
    }

```

If you also don’t want them listed on the hamburger drop-down menu:

```plaintext
.category .subcategories, .category-links .category-link.subcategory {
  display: none;
}

```

---

<div class="post-metadata">

### Author: ![Monte\_Kalisch](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/monte_kalisch/32/175020_2.png) [@Monte\_Kalisch](https://meta.discourse.org/u/Monte_Kalisch)
#### Post date: [4 december 2020 om 17:16 UTC](https://meta.discourse.org/t/how-do-i-suppress-a-subcategory-from-appearing-on-the-category-list/172178/4 "2020-12-04T17:16:57Z")

</div>

So I’m familiar with CSS but not sure where to add it for Discourse to use it.

---

<div class="post-metadata">

### Author: ![Jonathan5](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/jonathan5/32/197134_2.png) [@Jonathan5](https://meta.discourse.org/u/Jonathan5)
#### Post date: [4 december 2020 om 17:28 UTC](https://meta.discourse.org/t/how-do-i-suppress-a-subcategory-from-appearing-on-the-category-list/172178/5 "2020-12-04T17:28:22Z")

</div>

On the mobile so from memory but it’s something like this:

Admin  
Customise  
Themes  
Components  
Install (add name for new component)  
Edit HTML/CSS  
Apply theme component to themes

---

<div class="post-metadata">

### Author: ![sunjam](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/sunjam/32/175682_2.png) [@sunjam](https://meta.discourse.org/u/sunjam)
#### Post date: [4 december 2020 om 17:36 UTC](https://meta.discourse.org/t/how-do-i-suppress-a-subcategory-from-appearing-on-the-category-list/172178/6 "2020-12-04T17:36:45Z")

</div>

Another option… you could assign the sub-category to a group and restrict visibility to that group. Just fyi.

---

<div class="post-metadata">

### Author: ![Jonathan5](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/jonathan5/32/197134_2.png) [@Jonathan5](https://meta.discourse.org/u/Jonathan5)
#### Post date: [4 december 2020 om 17:38 UTC](https://meta.discourse.org/t/how-do-i-suppress-a-subcategory-from-appearing-on-the-category-list/172178/7 "2020-12-04T17:38:08Z")

</div>

Would that have other consequences beyond the main categories page? I’ve not used groups yet.

---

<div class="post-metadata">

### Author: ![sunjam](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/sunjam/32/175682_2.png) [@sunjam](https://meta.discourse.org/u/sunjam)
#### Post date: [4 december 2020 om 17:49 UTC](https://meta.discourse.org/t/how-do-i-suppress-a-subcategory-from-appearing-on-the-category-list/172178/8 "2020-12-04T17:49:45Z")

</div>

You create a [group](https://meta.discourse.org/g) called “Team Kids” then define who can join/view/participate in that group.

- Add a description, allow certain people to be “owners” who can moderate the group vs regular members.

Create a Category as we did for “Classes & Events”

- assign read/write/view access to the group under /Edit /Security for the category
- Notice how you can also change settings for “Everyone”, which includes all anonymous guests on the web, etc.  
 ![example-category-security](https://global.discourse-cdn.com/meta/original/3X/4/a/4a67b2468b7bcb1390c3f76315e2575e713a1e66.png)

OR

Simply stop the sub-category from showing up for `@everyone`. We restrict categories to only `@trust_level_0` users, which means registered users who are logged in. Or, `@trust_level_1` users who’ve been active on the platform a few weeks. These trust levels are actually all groups, too.

Hopefully this gives you some ideas on restricting your categories, rather than simply allowing them all to be crawled by google searches and viewed by random people online.

---

<div class="post-metadata">

### Author: ![Monte\_Kalisch](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/monte_kalisch/32/175020_2.png) [@Monte\_Kalisch](https://meta.discourse.org/u/Monte_Kalisch)
#### Post date: [4 december 2020 om 17:59 UTC](https://meta.discourse.org/t/how-do-i-suppress-a-subcategory-from-appearing-on-the-category-list/172178/9 "2020-12-04T17:59:50Z")

</div>

These are all very good suggestions; thank you. Ultimately, I was trying to create an Events group and then, in some cases, subgroups for the events underneath them. It’s an archive sub at this point, so I don’t need it front and center but don’t want to delete it.

---

<div class="post-metadata">

### Author: ![Monte\_Kalisch](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/monte_kalisch/32/175020_2.png) [@Monte\_Kalisch](https://meta.discourse.org/u/Monte_Kalisch)
#### Post date: [4 december 2020 om 18:01 UTC](https://meta.discourse.org/t/how-do-i-suppress-a-subcategory-from-appearing-on-the-category-list/172178/10 "2020-12-04T18:01:23Z")

</div>

Combined with @manuel’s CSS above, this worked perfectly. Thank you.

---

<div class="post-metadata">

### Author: ![sunjam](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/sunjam/32/175682_2.png) [@sunjam](https://meta.discourse.org/u/sunjam)
#### Post date: [5 december 2020 om 01:23 UTC](https://meta.discourse.org/t/how-do-i-suppress-a-subcategory-from-appearing-on-the-category-list/172178/11 "2020-12-05T01:23:25Z")

</div>

> [@Jonathan5](#):
>
> Would that have other consequences beyond the main categories page? I’ve not used groups yet.

Category Group access is defined within each specific category, so you have total control over any access a group will (or will not) actually have to a category. “Trust Levels” of users in Discourse, Staff, Admins, Moderators… all of these are literally just groups.

---

<div class="post-metadata">

### Author: ![Jonathan5](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/jonathan5/32/197134_2.png) [@Jonathan5](https://meta.discourse.org/u/Jonathan5)
#### Post date: [5 december 2020 om 02:10 UTC](https://meta.discourse.org/t/how-do-i-suppress-a-subcategory-from-appearing-on-the-category-list/172178/12 "2020-12-05T02:10:16Z")

</div>

This has been educational for me, so thank you, but I think you are solving a different problem to the one described in the original post. I get the impression he just wanted rid of the sub-category from the main categories page, but wanted it to behave normally otherwise.

---

<div class="post-metadata">

### Author: ![sunjam](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/sunjam/32/175682_2.png) [@sunjam](https://meta.discourse.org/u/sunjam)
#### Post date: [5 december 2020 om 02:25 UTC](https://meta.discourse.org/t/how-do-i-suppress-a-subcategory-from-appearing-on-the-category-list/172178/13 "2020-12-05T02:25:22Z")

</div>

These are the only ways I know to suppress a category: by group. The trust levels are all groups. Use or ignore as you please.

---

<div class="post-metadata">

### Author: ![selfaware](https://avatars.discourse-cdn.com/v4/letter/s/a587f6/32.png) [@selfaware](https://meta.discourse.org/u/selfaware)
#### Post date: [19 januari 2024 om 23:27 UTC](https://meta.discourse.org/t/how-do-i-suppress-a-subcategory-from-appearing-on-the-category-list/172178/14 "2024-01-19T23:27:32Z")

</div>

Hi,

In my situation I invoked the hidden option to nest 2 sub categories under a parent and in that situation only the last nested sub category is hidden. Is there a way, via CSS to hide two layers deep.

e.g.  
Parent Category  
sub category 1 - hide  
sub category 2 - hide

The CSS provided here in the above scenario only hides sub category 2.

```plaintext
.category .subcategories {
      display: none;
    }

```

Thank you.

---

<div class="post-metadata">

### Author: ![manuel](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/manuel/32/468169_2.png) [@manuel](https://meta.discourse.org/u/manuel)
#### Post date: [20 januari 2024 om 08:43 UTC](https://meta.discourse.org/t/how-do-i-suppress-a-subcategory-from-appearing-on-the-category-list/172178/15 "2024-01-20T08:43:08Z")

</div>

You’d need to inspect the additional element with your browser dev tools and then add it’s class to the style declaration.

 ![image](https://global.discourse-cdn.com/meta/original/4X/f/4/c/f4cf026ec597ca945ec3033d72444a98d16509a0.png)

---

<div class="post-metadata">

### Author: ![selfaware](https://avatars.discourse-cdn.com/v4/letter/s/a587f6/32.png) [@selfaware](https://meta.discourse.org/u/selfaware)
#### Post date: [20 januari 2024 om 22:40 UTC](https://meta.discourse.org/t/how-do-i-suppress-a-subcategory-from-appearing-on-the-category-list/172178/16 "2024-01-20T22:40:08Z")

</div>

Thanks for the reply!

Note: I’ve invoke the hidden feature that allows for an extra nested category, 3 total vs 2.

Here is an example that might better illustrate the issue:  
e.g., Main Page:  
Test (Category)

- Test - Sub 1 (nested Category of Parent Test Category)  
In this scenario,

```plaintext
.category .subcategories {
      display: none;
    }

```

works fine.  
 ![image](https://global.discourse-cdn.com/meta/original/4X/b/9/f/b9fce62b5adab3501dc9af9604d027cab7e10a82.png)  
As you can see the nested test - sub 1 category isn’t displayed.

If I add another nested subcategory:  
test - sub 2 category, with sub 1 category as it’s parent:

 ![image](https://global.discourse-cdn.com/meta/original/4X/a/e/c/aec79394a2aa6f1f68a34d2d25a2ca02dc473084.png)  
as you can see in the picture above, test - sub 2 is hidden  
per the css code, but test - sub 1 is no longer hidden.

The problem is now two fold:  
I can hide the test - sub 1 title, setting it’s class to display: none, but it also hides all of the parent categories on the main page.  
The 2nd problem, is that even if I could isolate the and hide just the test - sub 1 nested category, the space it occupies is still there and will be problematic, I need to have about 20 more categories on the main page with two nest sub categories each.  
Ideally I just want the end user to be able to click on the Test Category and have access to the other nested Categories, etc, which is easily accomplished, via  
Show subcategory list above topics in this category.  
and setting: sub category list styles to, e.g. boxes, etc.

If at some point I want to position another main page Cateogry after the Test Category, I don’t want 20 rows of blank linefeed, etc.

Thoughts?

---

<div class="post-metadata">

### Author: ![Heliosurge](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/heliosurge/32/571810_2.png) [@Heliosurge](https://meta.discourse.org/u/Heliosurge)
#### Post date: [20 januari 2024 om 23:11 UTC](https://meta.discourse.org/t/how-do-i-suppress-a-subcategory-from-appearing-on-the-category-list/172178/17 "2024-01-20T23:11:20Z")

</div>

Try this #Customization > Theme component

> [@Category Hider Theme Component](https://meta.discourse.org/t/category-hider-theme-component/181299):
>
> Hi all, I’ve created a simple theme component. I hope this could be of use for some! eyeglasses Overview This is a theme component that allows you to hide specific categories from either the hamburger menu or category boxes. thinking Why would you need this component? If your discourse website has a lot of categories and you would like to hide some from appearing in either the menu bar or on the main page, this component can be helpful. framed_picture Screenshots Preview of Hamburger Me…

---

<div class="post-metadata">

### Author: ![selfaware](https://avatars.discourse-cdn.com/v4/letter/s/a587f6/32.png) [@selfaware](https://meta.discourse.org/u/selfaware)
#### Post date: [21 januari 2024 om 02:44 UTC](https://meta.discourse.org/t/how-do-i-suppress-a-subcategory-from-appearing-on-the-category-list/172178/18 "2024-01-21T02:44:44Z")

</div>

Worked well - thank you!
