# Include by categories or terms (restrict to category)

This section describes, how to restrict the post type results to a certain category, or to multiple categories.

`Advanced options -> Exclude/Include results` panel

<figure><img src="/files/qyVhOLg6uUHYecCOzNbP" alt="" width="375"><figcaption><p>Restricting results to a category</p></figcaption></figure>

1. Go to the Advanced options -> Exclude results panel and scroll down until the `Include posts..` option
2. Choose a taxonomy and the terms will load. Select the ones you need by dragging them to the left side of the box.
3. Save the options, done

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

Tags: *search in category, limit to category, limit search to category, include results by category, include from category only, limit to specific category, limit to tag, limit to post tag, search only in one tag, search only in term, search limit to term*


---

# 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/include-by-categories-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.
