Skip to main content
drupalreleases

Use direct release data with your AI assistant.

Learn more

Lock Entity

No security coverage Under active development 2 sites

Lock Entity protects individual entities of any type from accidental deletion by marking them as protected. This allows administrators to prevent the removal of critical content such as nodes, taxonomy terms, users, and media.

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.

Ask your assistant about Lock Entity

Check compatibility with your Drupal and PHP version, maintenance and security coverage, from current release data. How it works

Depends on

Dependencies of the latest stable release

No dependencies recorded for this project.

Required by

Tracked projects that depend on this one

No tracked projects depend on this one yet.

Activity

Tracked releases
2
Tracked since
Jun 2026
Latest release
2 months ago
Releases (12 mo)
2 ▲ from 0
Maintenance
Active

Releases

Version Type Core PHP Release date
1.0.0-rc1 Pre-release 10–11 Aug 13, 2026
1.0.x-dev Dev 10–11 Jun 10, 2026