# 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: 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:

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

The question should be specific, self-contained, and written in natural language.
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.
