Skip to main content
drupalreleases

Use direct release data with your AI assistant.

Learn more

Prevent page deletion

Security covered Under active development 6,450 sites

This module protects your site's homepage, and optionally other designated pages, from being accidentally deleted or unpublished. It does this by adding a permission that controls who can perform these actions, ensuring critical pages remain accessible. The module hides delete buttons and prevents bulk actions for unauthorized users.

Synopsis

This module adds a permission 'delete homepage node'. Users with this permission can delete or unpublish the node that is defined as frontpage in the system settings, if other permissions allow them to. Users without this permission cannot. The main goals is to prevent deletion or depublication, not to grant users the permission to do so. So if other permissions prevent them from deleting a node, granting them this permission will not change that.

In version 3 of the module also the 404 and 403 pages are protected if they are defined in the settings. And there is a custom setting that allows you to add specific other URL's that are protected the same way.

Users who cannot delete this page will not see the delete-button on the nodes, and also this option will not be available on the administer content view. The "Published" checkbox on the edit-form will also be hidden. When the bulk-action for deletion or depublication is used a message will be shown that this operation is not permitted.

Usage

- Install with composer composer require 'drupal/prevent_homepage_deletion:^3.0'
- Enable the module
- Find the new permission to delete the homepage
- Grand it to users with care
(if the user also has the 'bypass node access'-permission, that will overrule the working of this module)
- If you want to protect extra nodes, go to "Configuration" > "System" > "Prevent page deletion" and enter one path per line to protect it

  • Node keep Module provides a checkbox on page level to protect pages
Drupal 9–11

Ask your assistant about Prevent page deletion

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

  • node Drupal core

Required by

Tracked projects that depend on this one

No tracked projects depend on this one yet.

Activity

Tracked releases
6
Tracked since
Apr 2023
Latest release
5 months ago
Releases (12 mo)
1 ▲ from 0
Maintenance
Active

Release Timeline

Releases

Version Type Core PHP Release date
3.0.2 Stable 9–11 May 7, 2026
3.0.1 Stable 9–11 Oct 10, 2024
3.0.0 Stable 9–11 Oct 9, 2024
2.0.4 Stable 8–11 PHP ^8.1 Jun 27, 2024
2.0.3 Stable 8–11 PHP ^8.1 Jun 19, 2024
2.0.2 Stable 8–10 Apr 14, 2023