Answers.Body: <p>If anyone lands on this page same as I did, the far far simpler way to do this is just to include the .type() method and combine it with the 'not' word:</p>
  <pre><code>{% set results = craft.entries({
    'search': query,
    'type': 'not chapter',
    'order': 'score'
  }) %}
  </code></pre>
  
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2022-10-21T14:04:14.187Z
Answers.Text: This is the correct modern answer to the OP
Answers.UserDisplayName: Adrian
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2020-09-04T12:03:51.963Z
Answers.LastActivityDate: 2020-09-04T12:03:51.963Z
Answers.UserDisplayName: darylknight
Answers.Body: <p>You can target the entry by ID and tell it 'not' to include it. The example below will exclude the current entry page. You can replace "#{entry.id}" with the ID of the entry you want to exclude.</p>
  
  <pre><code>{% set results = craft.entries({
    'id': "not #{entry.id}",
    'search': query,
    'order': 'score'
  }) %}
  </code></pre>
  
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2014-11-18T16:15:24.270Z
Answers.Text: Sorry if unclear but I wish to exclude all entries of an entry type, not a single entry.
Answers.UserDisplayName: hamishtaplin
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2014-11-18T16:14:22.267Z
Answers.LastActivityDate: 2014-11-18T16:14:22.267Z
Answers.UserDisplayName: Mark Notton
Answers.Body: <p>Going through Craft's docs, I found no easy or official way to do this. Fastest possible way, in my opinion:</p>
  
  <pre><code>{# get all section IDs #}
  {% set sections = craft.sections.getAllSections() %}
  
  {# get all entry types for sections #}
  {% set entryTypes = [] %}
  {% for section in sections %}
      {# exclude the entry type you don't want, add the others to 'entryTypes' variable
         you could, of course, replace handle by ID or whatever you like #}
      {% for entryType in section.getEntryTypes() if entryType.handle != 'handleToExclude' %}
          {% set entryTypes = entryTypes | merge([entryType]) %}
      {% endfor %}
  {% endfor %}
  
  {% set entries = craft.entries.section('inhoud').type(entryTypes) %}
  </code></pre>
  
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2018-10-13T06:52:43.663Z
Answers.Text: Works for me in Craft 3 with the following modification: `merge([entryType.handle])`
Answers.UserDisplayName: Crafty Cat
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2014-11-19T10:04:59.540Z
Answers.Text: This is what I tried but it doesn't work—I get 0 results.
Answers.UserDisplayName: hamishtaplin
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2014-11-19T11:45:46.873Z
Answers.Text: Could you show me your code?
Answers.UserDisplayName: Paul
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2014-11-20T09:06:05.187Z
Answers.Text: Exactly as you have it there, I get no results.
Answers.UserDisplayName: hamishtaplin
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2014-11-20T11:47:42.357Z
Answers.Text: Did you replace `entryTypeHandle` with your entry type's handle?
Answers.UserDisplayName: Paul
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2014-11-20T12:00:12.453Z
Answers.Text: Of course. Also, if I specify a type it works fine, just the 'not' bit seems to break things.
Answers.UserDisplayName: hamishtaplin
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2014-11-20T12:29:18.447Z
Answers.Text: Ok. You got me there. My solution doesn't work, and after diving into Crafts code I know why: the `type` criterium does not accept 'not'. It only accepts a string containing the entry type's handle, an Int with the entry type's id or an entryTypeModel. Or an array containing one or more of those. Let me think about the best way to work around this for a moment.
Answers.UserDisplayName: Paul
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2014-11-20T12:57:38.187Z
Answers.Text: Edited my answer, and tested the solution. It works on my side.
Answers.UserDisplayName: Paul
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2014-11-20T13:11:20.507Z
Answers.Text: Weird isn't it? Could well be a bug.
Answers.UserDisplayName: hamishtaplin
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2014-11-20T13:19:08.947Z
Answers.Text: Or a missing feature ;)
Answers.UserDisplayName: Paul
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2015-01-14T22:48:59.857Z
Answers.Text: Bump, missing feature. The not clause works on other fields but not the type field. :(
Answers.UserDisplayName: veritascs
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2014-11-18T16:44:44.087Z
Answers.LastActivityDate: 2018-08-17T10:14:35.813Z
Answers.LastEditDate: 2018-08-17T10:14:35.813Z
Answers.UserDisplayName: Paul
Body: <p>I would like to fetch all entries apart from those of a specific type: 'chapter'. How do I achieve this with a standard call to 'craft.entries'?</p>
  
  <pre><code>{% set results = craft.entries({
    'search': query,
    'order': 'score'
  }) %}
  </code></pre>
  
Tags: <entries>
Title: Is it possible exclude an entry type from result of craft.entries?
ThreadText: # Is it possible exclude an entry type from result of craft.entries?
  
  (Asked by: username_0 on 2014-11-18)
  
  I would like to fetch all entries apart from those of a specific type: 'chapter'. How do I achieve this with a standard call to 'craft.entries'?
  
  ```
  {% set results = craft.entries({
    'search': query,
    'order': 'score'
  }) %}
  
  ```
  
  **Tags:** entries
  
  
  ---
  
  ## 3 answers
  
  ### Answer by username_4 on 2014-11-18. Score: 7 | Accepted answer
  
  Going through Craft's docs, I found no easy or official way to do this. Fastest possible way, in my opinion:
  
  ```
  {# get all section IDs #}
  {% set sections = craft.sections.getAllSections() %}
  
  {# get all entry types for sections #}
  {% set entryTypes = [] %}
  {% for section in sections %}
      {# exclude the entry type you don't want, add the others to 'entryTypes' variable
         you could, of course, replace handle by ID or whatever you like #}
      {% for entryType in section.getEntryTypes() if entryType.handle != 'handleToExclude' %}
          {% set entryTypes = entryTypes | merge([entryType]) %}
      {% endfor %}
  {% endfor %}
  
  {% set entries = craft.entries.section('inhoud').type(entryTypes) %}
  
  ```
  
  > **Comments:**
  > **username_0**: This is what I tried but it doesn't work—I get 0 results.  
  > **username_4**: Could you show me your code?  
  > **username_0**: Exactly as you have it there, I get no results.  
  > **username_4**: Did you replace `entryTypeHandle` with your entry type's handle?  
  > **username_0**: Of course. Also, if I specify a type it works fine, just the 'not' bit seems to break things.  
  > **username_4**: Ok. You got me there. My solution doesn't work, and after diving into Crafts code I know why: the `type` criterium does not accept 'not'. It only accepts a string containing the entry type's handle, an Int with the entry type's id or an entryTypeModel. Or an array containing one or more of those. Let me think about the best way to work around this for a moment.  
  > **username_4**: Edited my answer, and tested the solution. It works on my side.  
  > **username_0**: Weird isn't it? Could well be a bug.  
  > **username_4**: Or a missing feature ;)  
  > **username_6**: Bump, missing feature. The not clause works on other fields but not the type field. :(  
  > **username_5**: Works for me in Craft 3 with the following modification: `merge([entryType.handle])`  
  
  ---
  
  ### Answer by username_1 on 2020-09-04. Score: 2
  
  If anyone lands on this page same as I did, the far far simpler way to do this is just to include the .type() method and combine it with the 'not' word:
  
  ```
  {% set results = craft.entries({
    'search': query,
    'type': 'not chapter',
    'order': 'score'
  }) %}
  
  ```
  
  > **Comments:**
  > **username_2**: This is the correct modern answer to the OP  
  
  ---
  
  ### Answer by username_3 on 2014-11-18. Score: 1
  
  You can target the entry by ID and tell it 'not' to include it. The example below will exclude the current entry page. You can replace "#{entry.id}" with the ID of the entry you want to exclude.
  
  ```
  {% set results = craft.entries({
    'id': "not #{entry.id}",
    'search': query,
    'order': 'score'
  }) %}
  
  ```
  
  > **Comments:**
  > **username_0**: Sorry if unclear but I wish to exclude all entries of an entry type, not a single entry.  
  
  ---
  
  