<p>In my site-wide search module I like to exclude any entries that are a Single.</p>
<p>Since we cannot do this by checking for a type, I found that Singles entries do not have an author ID. So the easiest way in my scenario is to exclude entries with no <code>authorID</code>.
In my setup there is only one author with the ID of 1.</p>
<p>According to <a href="https://craftcms.com/docs/3.x/entries.html#authorid" rel="nofollow noreferrer">the docs</a> this should work:</p>
<pre><code>{% set entryQuery = craft.entries(queryParameters).authorId('not 1').orderBy(orderBy).limit(10) %}
</code></pre>
<p>But no matter what I set for <code>authorId</code> I always also get all entries that have no author ID set. Setting a non-existing author ID also gives me results.</p>
<p>All forum entries point to this working, so my only conclusion is that because I'm using Craft's Solo edition (3.4.23) maybe the whole user-related section is not active?</p>

CC BY-SA 4.0
2020-08-20T09:41:54.107Z
This doesn't answer your question directly, but for site search functionality, I would highly recommend reversing your logic to only include the sections you want to be searchable rather than searching everything by default and then making some exclusions. Why? Because 6 months from now you'll forget the search functionality even exists and add some kind of private or draft/unlaunched section and all of sudden it starts turning up in your search results...
James Smith
CC BY-SA 4.0
2020-08-21T23:51:07.227Z
@JamesSmith Good tip, thank you.
Crafty Cat
<singles><author>
How to exclude all Singles entries with Twig query?
# How to exclude all Singles entries with Twig query?

(Asked by: username_0 on 2020-08-19)

In my site-wide search module I like to exclude any entries that are a Single.
Since we cannot do this by checking for a type, I found that Singles entries do not have an author ID. So the easiest way in my scenario is to exclude entries with no authorID.
In my setup there is only one author with the ID of 1.
According to the docs this should work:
{% set entryQuery = craft.entries(queryParameters).authorId('not 1').orderBy(orderBy).limit(10) %}

But no matter what I set for authorId I always also get all entries that have no author ID set. Setting a non-existing author ID also gives me results.
All forum entries point to this working, so my only conclusion is that because I'm using Craft's Solo edition (3.4.23) maybe the whole user-related section is not active?

**Tags:** singles, author
> **Comments:**
> **username_1**: This doesn't answer your question directly, but for site search functionality, I would highly recommend reversing your logic to only include the sections you want to be searchable rather than searching everything by default and then making some exclusions. Why? Because 6 months from now you'll forget the search functionality even exists and add some kind of private or draft/unlaunched section and all of sudden it starts turning up in your search results...  
> **username_0**: @JamesSmith Good tip, thank you.  

---

## 0 answers

