# Exclude category from search

**URL:** <https://meta.discourse.org/t/exclude-category-from-search/46069>\
**Category:** Feature\
**Created:** [June 20, 2016, 12:54pm UTC](https://meta.discourse.org/t/exclude-category-from-search/46069 "2016-06-20T12:54:36Z")\
**Posts on this page:** 1\
**Showing post:** 9

<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:** [October 4, 2016, 3:09pm 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>

---

_[View the full topic](https://meta.discourse.org/t/exclude-category-from-search/46069)._
