<p>This should do what you're looking for:</p>

<pre><code>{% set someEntries = craft.entries({
    level: 1,
    id: '1,2,3,4,5',
    myOtherField: 'and, not blue, not green'
}) %}
</code></pre>

CC BY-SA 3.0
2017-06-30T21:33:47.200Z
2017-06-30T21:33:47.200Z
Brad Bell
<p>I'm trying to return entries based on some criteria. I exclude entries with a given value like this:</p>

<pre><code>{% set someEntries = craft.entries({
    level: 1,
    id: '1,2,3,4,5',
    myOtherField: 'not blue'
}) %}
</code></pre>

<p>But it doesn't work if I try to exclude by multiple values:</p>

<pre><code>{% set someEntries = craft.entries({
    level: 1,
    id: '1,2,3,4,5',
    myOtherField: 'not blue and not green'
}) %}
</code></pre>

<p>It's not in <a href="https://craftcms.com/docs/templating/elementcriteriamodel" rel="nofollow noreferrer">the docs</a> and I've tried a few different syntax but had no luck.</p>

<entries><conditional><params>
Using AND with craft.entries()
# Using AND with craft.entries()

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

I'm trying to return entries based on some criteria. I exclude entries with a given value like this:
{% set someEntries = craft.entries({
    level: 1,
    id: '1,2,3,4,5',
    myOtherField: 'not blue'
}) %}

But it doesn't work if I try to exclude by multiple values:
{% set someEntries = craft.entries({
    level: 1,
    id: '1,2,3,4,5',
    myOtherField: 'not blue and not green'
}) %}

It's not in the docs and I've tried a few different syntax but had no luck.

**Tags:** entries, conditional, params

---

## 1 answers

### Answer by username_1 on 2017-06-30. Score: 1 | Accepted answer

This should do what you're looking for:
{% set someEntries = craft.entries({
    level: 1,
    id: '1,2,3,4,5',
    myOtherField: 'and, not blue, not green'
}) %}


---

