Drupal is a registered trademark of Dries Buytaert
Release: Leaflet 10.4.11 Minor update available for module leaflet (10.4.11). Release: Session Inspector 1.0.8 Minor update available for module session_inspector (1.0.8). Release: Migrate QA 2.0.4 Minor update available for module migrate_qa (2.0.4). Release: CKEditor Description List 3.0.0 Major update available for module ckeditor_descriptionlist (3.0.0). Release: FlowDrop 2.4.0 Minor update available for module flowdrop (2.4.0). Release: JWT Token Refresh 1.0.4 Minor update available for module jwt_token_refresh (1.0.4). Release: ConReg 1.0.0-beta1 First beta version released for module conreg (1.0.0-beta1). Release: AI Image Studio 1.0.0-beta8 New beta version released for module ai_image_studio (1.0.0-beta8). Usage Milestone: Role Theme Switcher Module role_theme_switcher crossed 1,000 active installs. Module Revived: Decoupled Router 2.0.7 Module decoupled_router updated after 11 months of inactivity (2.0.7).

This module allows you to configure pairs of flags so that only one flag in the pair can be set on an entity at a time. For example, if you have a "like" and "dislike" flag on a post, setting one will automatically remove the other.

This module enforces mutual exclusion between configured groups of (Flag module) flags on the same entity. When a user sets one flag in a group of flags on an entity, the remaining flags are unset.

Features

The Flag module does not natively enforce mutual exclusion among flags. This module adds that capability by listening to Flag's ENTITY_FLAGGED event and automatically unsets the counterpart flags when one flag in a configured group is set.

Common use case:

  • like/dislike reactions (group of two flags) where a user can hold only one at a time. Any number of groups can be configured, across any entity types and any flags that Flag supports.
  • multiple choice settings (groups of multiple flags) where a user can select only one selection at a time. Up to 10 flags can be configured in a group. Common examples might be: subscription levels on a member plan, multiple choice options on an exam, user polls

Post-installation instructions are summarized below, additional documentation is contained in the module’s README file.

Breaking change (Release 1.1.x) : prior to this release, the module used a “pairs" model (exactly two flags per rule, stored under a pairs config key). This release replaces pairs entirely with a groups model (2-10 flags per rule, stored under a groups config key). Existing pair configuration is automatically migrated to groups the next time you run database updates — see "Upgrading from 1.0” in the README.

Post-Installation

1. Navigate to Administration → Structure → Flags (/admin/structure/flags) and add the flags that are intended to work as a mutually exclusive group. Make a note of their names, and the entity type to which they're configured to apply.

2. Navigate to Configuration → Content authoring → Flag mutually exclusive
(/admin/config/content/flag-mutually-exclusive) and click Add group.

Configuration is exported as part of flag_mutually_exclusive.settings and
is included in drush config:export / drush config:import deployments.

Setting Description Label Human-readable name for the group, e.g. "Like / Dislike" Machine name Unique identifier, auto-generated from the label Entity type Machine name of the entity type all flags in the group apply to Flags 2 to 10 flags — setting any one unsets all the others in the group. The list refreshes via AJAX to show only flags compatible with the selected entity type, and a counter shows how many are currently selected. Enabled Uncheck to temporarily disable without deleting

Configuration is exported as part of flag_mutually_exclusive.settings`and
is included in drush config:export / drush config:import deployments.

Additional Requirements

- Drupal ^11.3
- flag:flag (>=5.0.0)

Similar projects

Rules can be used to configure this functionality. However Rules is heavyweight, this module targets a specific set of functionality that managed Flags on entities in a specific manner, and provides that functionality without the overhead of Rules.

Supporting this Module

This module is supported by Lisa Harrison (lisa.rae), an individual contributor and long-time member of the Drupal community.

Activity

Tracked releases
7
Tracked since
Jul 2026
Latest release
2 weeks ago
Releases (12 mo)
7 ▲ from 0
Maintenance
Active

Release Timeline

Releases

Version Type Release date
1.1.0-beta1 Pre-release Aug 4, 2026
1.1.x-dev Dev Jul 26, 2026
1.0.1 Stable Jul 26, 2026
1.0.0 Stable Jul 14, 2026
1.0.0-beta1 Pre-release Jul 2, 2026
1.0.0-alpha1 Pre-release Jul 2, 2026
1.0.x-dev Dev Jul 2, 2026