<p>You can do that like so:</p>

<pre><code>{% set params = { group: 'and, not groupX, not groupY' } %}
</code></pre>

CC BY-SA 3.0
2014-07-17T12:29:50.280Z
2014-07-17T12:29:50.280Z
Brandon Kelly
<p>I have a client who needs the flexibility to add new user groups in the future to allow access to only certain sections etc.</p>

<p>Anyone in these user groups will appear on the website team page, so what I need to do is to exclude our admin group (and an ex employees group!)</p>

<p>Currently i'm chaining the groups to include as per:</p>

<pre><code>{% set params = { group: 'groupB,groupC,etc,etc,etc'} %}
{% for team in craft.users(params) %}
</code></pre>

<p>Is there a way of telling it to just exclude groupA instead?</p>

<users>
Exclude groups from user search
# Exclude groups from user search

(Asked by: username_0 on 2014-07-17)

I have a client who needs the flexibility to add new user groups in the future to allow access to only certain sections etc.
Anyone in these user groups will appear on the website team page, so what I need to do is to exclude our admin group (and an ex employees group!)
Currently i'm chaining the groups to include as per:
{% set params = { group: 'groupB,groupC,etc,etc,etc'} %}
{% for team in craft.users(params) %}

Is there a way of telling it to just exclude groupA instead?

**Tags:** users

---

## 1 answers

### Answer by username_1 on 2014-07-17. Score: 5 | Accepted answer

You can do that like so:
{% set params = { group: 'and, not groupX, not groupY' } %}


---

