> For the complete documentation index, see [llms.txt](https://documentation.ajaxsearchpro.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://documentation.ajaxsearchpro.com/advanced-options/excluding-and-including-results/exclude-by-category-or-terms.md).

# Exclude by category or terms

## Excluding Posts or any Custom Post Type by categories or terms

`Advanced Options -> Exclude results` panel

![](http://i.imgur.com/NfgVM8z.png)

1. Scroll down on the *Advanced Options -> Exclude results* panel
2. Select a taxonomy, then drag the terms (categories) from the left  box to the right box to exclude.
3. Save the options, done.

*Posts (or any post type objects) types marked with the excluded categories won't show up on the results list.*

### Hiding posts (or any CPT) with no categories or terms

By default, selected post type objects which are not associated with any terms will appear in the results list.

If you whish to exclude them as well, then trun OFF the `Show posts/CPM with empty taxonomy terms?` option on the `Frontend Search Settings -> Advanced` panel:

![](http://i.imgur.com/A6v6f1i.png)

## Further notes

Category and taxonomy term exclusion will drop posts belonging to at least one of the excluded categories. This way if some posts belong to a certain **parent->child1** category and other belong to **parent->child2** category and category "child1" is excluded, then the posts from category "child2" will still show up.

Excluding the parent category will however exclude all the posts belonging to the child categories as well, as it's expected.


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://documentation.ajaxsearchpro.com/advanced-options/excluding-and-including-results/exclude-by-category-or-terms.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
