Drupal is a registered trademark of Dries Buytaert
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)! drupal 11.3.9 Update released for Drupal core (11.3.9)! drupal 11.3.8 Update released for Drupal core (11.3.8)! drupal 11.3.7 Update released for Drupal core (11.3.7)! drupal 11.2.11 Update released for Drupal core (11.2.11)! drupal 10.6.7 Update released for Drupal core (10.6.7)! drupal 10.5.9 Update released for Drupal core (10.5.9)! cms 2.1.1 Update released for Drupal core (2.1.1)!

lock_entity

No security coverage
View on drupal.org

Lock Entity prevents deletion of any entity type by marking individual entities as protected. Inspired by Prevent Homepage Deletion, it extends that concept beyond the homepage to any entity type: nodes, taxonomy terms, users, media, and more.

Lock Entity prevents deletion of any entity type by marking individual entities as protected. Administrators can lock nodes, taxonomy terms, users, media, or any other entity, preventing accidental deletion of critical content.

Features

  • Lock any entity type (nodes, taxonomy terms, users, media, and more)
  • Optional per-lock reason shown to users who attempt deletion
  • Prevents unpublishing of locked published entities (closes an indirect workaround)
  • Admin UI at /admin/config/system/lock-entity
  • Locks are stored in configuration and export cleanly with drush cex

Post-Installation

After enabling the module, navigate to Administration > Configuration > System > Lock Entity (/admin/config/system/lock-entity).

Use the Add a new lock section to select an entity type, enter the entity ID, and optionally provide a human-readable reason for the lock. The reason is shown to users who attempt to delete the entity.

To remove a lock, click Remove next to the entry in the locked entities table. Until removed, no user, including administrators, can delete the locked entity.

The lock can only be removed by a user with the Administer site configuration permission, via /admin/config/system/lock-entity.

Additional Requirements

No additional modules or libraries are required. Drupal core 10 or 11 is sufficient.

None required.

Similar projects

  • Prevent Homepage Deletion — the original inspiration for this module. Locks only the homepage node. Lock Entity generalizes this to any entity type and any entity ID.
  • Config Readonly — locks configuration rather than content entities.
  • Node Keep — similar concept but limited to nodes only. Lock Entity covers all entity types.

Supporting this Module

Patches, bug reports, and feature requests are welcome via the issue queue.

Activity

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

Releases

Version Type Release date
1.0.x-dev Dev Jun 10, 2026