<p>If you mean entire sections you could define which sections you want to display like this:</p>

<pre><code>{% set query = craft.request.getParam('q') %}
{% set entries = craft.entries.craft.entries.section('section1, section2, section3').search(query).order('score') %}
</code></pre>

CC BY-SA 3.0
2017-06-22T14:42:05.910Z
2017-06-22T14:42:05.910Z
Justin Dekkers
<p>One way would be to create an array of ids to exclude and then use the <code>not</code> filter:</p>

<pre><code>{% set query = craft.request.getParam('q') %}
{% set idsToExclude = [14,15] %}
{% set idsToExcludeString = idsToExclude|join(', not ') %}
{% set entries = craft.entries.search(query).order('score').id('and, not ' ~ idsToExcludeString) %}
</code></pre>

CC BY-SA 3.0
2017-06-22T19:24:09.817Z
2017-06-22T19:24:09.817Z
Dalton Rooney
<p>I have some pages that I want to exclude from search results. How can I do this?</p>

<search>
Is it possible to exclude entry from search index?
# Is it possible to exclude entry from search index?

(Asked by: username_0 on 2017-06-22)

I have some pages that I want to exclude from search results. How can I do this?

**Tags:** search


---

## 2 answers

### Answer by username_1 on 2017-06-22. Score: 1

If you mean entire sections you could define which sections you want to display like this:
{% set query = craft.request.getParam('q') %}
{% set entries = craft.entries.craft.entries.section('section1, section2, section3').search(query).order('score') %}


---

### Answer by username_2 on 2017-06-22. Score: 1

One way would be to create an array of ids to exclude and then use the not filter:
{% set query = craft.request.getParam('q') %}
{% set idsToExclude = [14,15] %}
{% set idsToExcludeString = idsToExclude|join(', not ') %}
{% set entries = craft.entries.search(query).order('score').id('and, not ' ~ idsToExcludeString) %}


---

