<p>This should work for a single section:</p>

<pre><code>{% set entries = craft.entries.section('not news').search(query).order('score') %}
</code></pre>

<p>to exclude more sections:</p>

<pre><code>{% set entries = craft.entries.section([
    'and', 'not news', 'not blog'
]).search(query).order('score') %}
</code></pre>

CC BY-SA 3.0
2015-11-06T15:09:36.943Z
2015-11-06T15:09:36.943Z
carlcs
<p>I'm trying to figure out how to exclude a Channel, Structure or Singles from my search results.</p>

<p>Currently I have the default example from Craft</p>

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

<templating><search>
How do I exclude a Channel, Structure or Singles from search?
# How do I exclude a Channel, Structure or Singles from search?

(Asked by: username_0 on 2015-11-06)

I'm trying to figure out how to exclude a Channel, Structure or Singles from my search results.
Currently I have the default example from Craft
{% set query = craft.request.getParam('q') %}
{% set entries = craft.entries.search(query).order('score') %}

**Tags:** templating, search

---

## 1 answers

### Answer by username_1 on 2015-11-06. Score: 10 | Accepted answer

This should work for a single section:
{% set entries = craft.entries.section('not news').search(query).order('score') %}

to exclude more sections:
{% set entries = craft.entries.section([
    'and', 'not news', 'not blog'
]).search(query).order('score') %}


---

