wazum/page-deletion-guard

Prevents deletion of pages with children in TYPO3 backend

Installs: 26

Dependents: 0

Suggesters: 0

Security: 0

Stars: 0

Watchers: 0

Forks: 0

Open Issues: 0

Type:typo3-cms-extension

pkg:composer/wazum/page-deletion-guard

1.0.0 2025-10-21 12:06 UTC

This package is auto-updated.

Last update: 2025-10-23 20:09:12 UTC


README

CI PHP TYPO3 License

A TYPO3 extension that prevents accidental deletion of pages with child pages in the backend. This extension restores the safety guard that was removed in TYPO3 v11 (Breaking Change #92560).

Warning

TYPO3 core developers recommend using the Recycler to restore accidentally deleted pages. However, since TYPO3 does not use database transactions for page operations, any timeout or error during recursive deletion or restoration can leave your page tree in an inconsistent, partially deleted state. The Recycler cannot reliably fix such broken structures. This extension prevents these scenarios by blocking risky deletions before they even happen!

Quick Start

composer require wazum/page-deletion-guard

The extension works immediately after installation with sensible defaults. Administrators can bypass the guard, regular editors cannot delete pages with children.

The Problem

Since TYPO3 v11, backend editors can delete entire page trees with a single click. This increases the risk of:

  • Accidental deletion of important page structures
  • Loss of content without warning
  • No built-in protection against recursive deletion

Features

  • Prevents accidental deletion of pages with child pages
  • Shows warning modal with exact child page count before deletion
  • Administrators can bypass the protection when needed
  • Works in all backend modules (page tree, list module, etc.)
  • Configurable per backend user group
  • Logs all blocked deletion attempts

Installation

composer require wazum/page-deletion-guard

The extension activates automatically with these defaults:

  • Protection enabled
  • Admin bypass allowed
  • Regular editors cannot delete pages with children

No additional configuration required unless you want to customize the behavior.

Configuration

Configure the extension via Admin Tools → Settings → Extension Configuration → page_deletion_guard:

Available Options

  • enabled (boolean, default: true) Enable or disable the deletion guard entirely.

  • allowAdminBypass (boolean, default: true) Allow administrators to delete pages with children. When disabled, even admins must delete child pages first.

  • bypassBackendGroups (string, default: empty) Comma-separated list of backend user group IDs that can bypass the guard. Example: 5,10,15

  • respectWorkspaces (boolean, default: true) When enabled, workspace restrictions are applied to child page queries. Disable to count all children regardless of workspace.

License

GNU General Public License version 2 or later (GPL-2.0-or-later)

Author

Wolfgang Klinger wolfgang@wazum.com