Drupal is a registered trademark of Dries Buytaert
drupal 11.4.0 Update released for Drupal core (11.4.0)! drupal 10.6.12 Update released for Drupal core (10.6.12)! drupal 11.3.13 Update released for Drupal core (11.3.13)! drupal 10.6.11 Update released for Drupal core (10.6.11)! drupal 11.3.12 Update released for Drupal core (11.3.12)! drupal 11.2.14 Update released for Drupal core (11.2.14)! drupal 10.5.12 Update released for Drupal core (10.5.12)! cms 2.1.3 Update released for Drupal core (2.1.3)! drupal 10.5.11 Update released for Drupal core (10.5.11)! drupal 11.3.11 Update released for Drupal core (11.3.11)! drupal 11.2.13 Update released for Drupal core (11.2.13)! drupal 10.6.10 Update released for Drupal core (10.6.10)! cms 2.1.2 Update released for Drupal core (2.1.2)! drupal 11.1.10 Update released for Drupal core (11.1.10)! drupal 10.5.10 Update released for Drupal core (10.5.10)! drupal 10.4.10 Update released for Drupal core (10.4.10)! drupal 11.2.12 Update released for Drupal core (11.2.12)! drupal 11.3.10 Update released for Drupal core (11.3.10)! drupal 10.6.9 Update released for Drupal core (10.6.9)! drupal 10.6.8 Update released for Drupal core (10.6.8)!

This module enforces mutual exclusion between configured pairs of Flag flags on the same entity. When a user sets flag A on an entity, flag B is automatically unset, and vice versa.

Features

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

Common use case: like/dislike reactions where a user can hold only one at a time. Any number of pairs can be configured, across any entity types and any flags that Flag supports.

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

Post-Installation

1. Navigate to Administration → Structure → Flags(/admin/structure/flags) and add two flags that are intended to work in tandem. Make a note of their names, and the Entity 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 pair.

Setting Description Label Human-readable name, e.g. "Like / Dislike" Machine name Unique identifier, auto-generated from the label Flag A First flag in the pair Flag B Second flag in the pair — setting either flag unsets the other Entity type Machine name of the entity type the flags are configured to apply 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

Total releases
3
First release
Jul 2026
Latest release
1 day ago
Release cadence
0 days
Stability
0% stable

Release Timeline

Releases

Version Type Release date
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