About
This module aims to provide a way to automatically clean up blocks that may have been deleted, and result in "This block is broken or missing. You may be missing content or you might need to enable the original module." when you've placed those blocks on a Layout Builder based display for a node content type.
For example, let's say you have a "Promotion" custom block you've created and placed in the default template for your "Product" page. Now, you've deleted that block through the UI. All 100 of your "Product" nodes are now going to display the "Block is broken" error message. With this module, you should be able to quickly remedy the situation leveraging the batched cleanup process.
The module will examine a specified node or all nodes, and remove any broken blocks. It will also examine the default layout, and if any offending blocks are found, it also removes those.
Currently under development. Open to collaborators and suggestions.
How to use
Through the UI
* Enable the module, assign "Use layout builder block sanitizer" permission to appropriate user role.
* Go to /admin/structure/lbbs/sanitizer
Via drush
* Enable the module
* Run drush help lbbssn to get details on running the command as needed.
Future possible updates
* Scale up functionality to run a batch on all nodes on site of a selected type
* UI for selecting specific nodes to run on
* Add a cron task that can auto clean up nodes
Please open any issues with ideas, suggestions, etc.
Ask your assistant about Layout Builder Block Sanitizer
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
Release Timeline
Releases
| Version | Type | Core | PHP | Release date | |
|---|---|---|---|---|---|
| 8.x-1.0-alpha7 | Pre-release | 8–11 | Nov 30, 2026 | ||
| 8.x-1.0-alpha6 | Pre-release | 8–11 | Nov 30, 2026 | ||
| 8.x-1.0-alpha5 | Pre-release | 8–11 | Nov 30, 2026 |