# Exclude category from search

**URL:** https://meta.discourse.org/t/exclude-category-from-search/46069
**Category:** Feature
**Created:** [2016年六月20日 12:54 UTC](https://meta.discourse.org/t/exclude-category-from-search/46069 "2016-06-20T12:54:36Z")
**Posts on this page:** 10
**Page:** 1

<div class="post-metadata">

### Author: ![jmamazo](https://avatars.discourse-cdn.com/v4/letter/j/22d042/32.png) [@jmamazo](https://meta.discourse.org/u/jmamazo)
#### Post date: [2016年六月20日 12:54 UTC](https://meta.discourse.org/t/exclude-category-from-search/46069/1 "2016-06-20T12:54:36Z")

</div>

Hello guys

Is there a way to exclude a category from “search” I mean forum wide. I know I can use advanced filter but most users just dont bother about checking those and we would like to always exclude a category from search results.

Thanks

---

<div class="post-metadata">

### Author: ![erlend\_sh](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/erlend_sh/32/119475_2.png) [@erlend\_sh](https://meta.discourse.org/u/erlend_sh)
#### Post date: [2016年六月20日 13:10 UTC](https://meta.discourse.org/t/exclude-category-from-search/46069/2 "2016-06-20T13:10:12Z")

</div>

Do you mean exclude _the topics in a specific category_ from searches?

---

<div class="post-metadata">

### Author: ![jmamazo](https://avatars.discourse-cdn.com/v4/letter/j/22d042/32.png) [@jmamazo](https://meta.discourse.org/u/jmamazo)
#### Post date: [2016年六月20日 13:13 UTC](https://meta.discourse.org/t/exclude-category-from-search/46069/3 "2016-06-20T13:13:25Z")

</div>

yes, completely ignoring it 😀 our dream is much more complicated than that, like (ignore it unless it hast 3 posts for example, but I know thats too much to ask)  
Best

---

<div class="post-metadata">

### Author: ![erlend\_sh](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/erlend_sh/32/119475_2.png) [@erlend\_sh](https://meta.discourse.org/u/erlend_sh)
#### Post date: [2016年六月20日 14:20 UTC](https://meta.discourse.org/t/exclude-category-from-search/46069/4 "2016-06-20T14:20:17Z")

</div>

The closest thing to this is probably “[Unlisted categories](https://meta.discourse.org/t/unlisted-categories/46066)”, which is a new feature under consideration.

---

<div class="post-metadata">

### Author: ![codinghorror](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/codinghorror/32/110067_2.png) [@codinghorror](https://meta.discourse.org/u/codinghorror)
#### Post date: [2016年六月20日 21:37 UTC](https://meta.discourse.org/t/exclude-category-from-search/46069/5 "2016-06-20T21:37:29Z")

</div>

Unlisted would not affect search though. That should not even be on the table as it significantly complicates things. (category security would affect it anyway, as usual)

---

<div class="post-metadata">

### Author: ![sam](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/sam/32/102149_2.png) [@sam](https://meta.discourse.org/u/sam)
#### Post date: [2016年六月21日 00:45 UTC](https://meta.discourse.org/t/exclude-category-from-search/46069/6 "2016-06-21T00:45:55Z")

</div>

I definitely want to add a feature that allows admins to set “search priority” for categories, so, for example: #faq always gets a bump and shows up first.

I think this is a better feature than totally removing results from search, if users are allowed to read the topics, why not allow them to find them @jmamazo ?

---

<div class="post-metadata">

### Author: ![jmamazo](https://avatars.discourse-cdn.com/v4/letter/j/22d042/32.png) [@jmamazo](https://meta.discourse.org/u/jmamazo)
#### Post date: [2016年六月21日 08:28 UTC](https://meta.discourse.org/t/exclude-category-from-search/46069/7 "2016-06-21T08:28:01Z")

</div>

I totally agree with you, but then it would be better if category XXX is always last to show, so the most interesting categories are always on top of the search.  
Our use-case:  
Every time our web-application creates a project a post is created announcing the creation, this allow us to have comments in that project inside our website. Then we have a real forum with way more interesting categories where people are usually active in topics not always related to the projects. and then when you have 1000s of projects then you have a lots of posts that “real forum users” are not interested (95% of time).

---

<div class="post-metadata">

### Author: ![SidV](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/sidv/32/119460_2.png) [@SidV](https://meta.discourse.org/u/SidV)
#### Post date: [2016年十月4日 13:02 UTC](https://meta.discourse.org/t/exclude-category-from-search/46069/8 "2016-10-04T13:02:31Z")

</div>

Hello, I need to exlude a sub-category from searching.

Example:

> status:noreplies category:5

But, category 5, has got two more sub-categories (6 and 7).  
How can I search only threads in category 5, and don’t show the others discussions in categories 6 and 7?

---

<div class="post-metadata">

### Author: ![cpradio](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/cpradio/32/4970_2.png) [@cpradio](https://meta.discourse.org/u/cpradio)
#### Post date: [2016年十月4日 15:09 UTC](https://meta.discourse.org/t/exclude-category-from-search/46069/9 "2016-10-04T15:09:36Z")

</div>

I don’t think that is possible yet. From what I can tell, when you specify category:5 or #category5, it will search both that category and any categories that have it as its parent.

Relevant code:

> <https://github.com/discourse/discourse/blob/main/lib/search.rb#L314-L344>

---

<div class="post-metadata">

### Author: ![tgxworld](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/tgxworld/32/106117_2.png) [@tgxworld](https://meta.discourse.org/u/tgxworld)
#### Post date: [2019年四月5日 05:29 UTC](https://meta.discourse.org/t/exclude-category-from-search/46069/10 "2019-04-05T05:29:28Z")

</div>

> [@Search Improvements in 2.3](https://meta.discourse.org/t/search-improvements-in-2-3/113411):
>
> For the upcoming 2.3 release, we’ve added a new feature and made several fixes to the way we index posts for search that will make search results better. 1. Search Priorities for Categories Each individual category can be configured with a search priority which you can find under the Settings tab when creating/editing a category. Five levels for prioritization have been added: ignore, very low, low, high and very high. The levels work by multiplying…
