Field type that let you select one or more user groups

Fund package maintenance!

Installs: 11 324

Dependents: 0

Suggesters: 0

Security: 0

Stars: 7

Watchers: 3

Forks: 3

Open Issues: 0


3.0.1 2022-08-03 00:35 UTC

This package is auto-updated.

Last update: 2022-11-23 00:59:25 UTC


A field type that lets you select one or more user groups.


You can install User Group Field via the plugin store, or through Composer.

Craft Plugin Store

To install User Group Field, navigate to the Plugin Store section of your Craft control panel, search for User Group Field, and click the Try button.


You can also add the package to your project using Composer and the command line.

  1. Open your terminal and go to your Craft project:
cd /path/to/project
  1. Then tell Composer to require the plugin, and Craft to install it:
composer require verbb/user-group-field && php craft plugin/install user-group-field


This plugin provides a Field Type where you can select one or more user groups. To create the field, go to Settings → Fields in your control panel.

Field Settings

There is 3 display modes:

  • As a dropdown, where you can select only 1 group.
  • As a group of checkboxes, where you can select 1 or more groups.
  • As a group of radio buttons, where you can select only 1 group.


To list the group(s) selected:

{% set groups = entry.userGroupFieldHandle.getGroups() %}

{% for group in groups %}
    {{ }}
{% endfor %}

To get only the first group:

{% set groups = entry.userGroupFieldHandle.getGroups() | first %}

{{ }}

To check if the current user is in any of the groups selected:

{% if entry.userGroupFieldHandle.inGroup(currentUser) %}
    <h1>User can access</h1>
{% endif %}

To check if the current user can access something based on the group selection:

{% if entry.userGroupFieldHandle.canAccess(currentUser) %}
    <h1>User can access</h1>
{% endif %}

Note: This check is always true for admins.

You can also query a User Group Field based on the uid of a user.

{% set userGroup ='myUserGroup') %}

{% set entries = craft.entries.section('blog').userGroupFieldHandle(userGroup.uid).all() %}


Originally created by the team at Superbig.

Show your Support

User Group Field is licensed under the MIT license, meaning it will always be free and open source – we love free stuff! If you'd like to show your support to the plugin regardless, Sponsor development.