Advertising sustains the DA. Ads are hidden for members. Join today

Contributed module documentation

Drupal Cleanup

Drupal Cleanup finds and removes the leftover data a Drupal site builds up over time: search index rows, moderation states, queue items and custom table rows for content that no longer exists, plus abandoned batch jobs that core never purges.

Core cleans up after itself when content is deleted normally. But real sites also delete content in ways that skip the entity API: migrations, direct SQL, a bulk delete that dies halfway, or old code from before core handled it. What gets left behind never goes away. It bloats tables, slows queries and backups, and can surface dead results. This module finds those rows safely and removes them on a schedule, with a dry run so you can see what it would do first.

Backs Up

Backs up before every delete, with no exceptions.

Code and cache mismatches

Code and cache mismatches report.

Compliance and records retention

Compliance and records retention

Content Moderation orphans

Removes moderation states (and all their revisions) whose content is gone

Custom table orphans

Any module can declare its own tables that store entity IDs in a small YAML file, and Drupal Cleanup keeps them tidy.

Large Files

Builds a report of large files.

Old working files

Clears out scratch folders that imports and conversions leave on disk, by age, but only in folders a module has explicitly declared.

Queue items for deleted entities

Removes queued jobs whose target entity is gone, before a worker trips over them.

Search index orphans

Removes Core Search index entries for content that no longer exists

Stale batches

Purges abandoned rows from the batch table, plus the leftover drupal_batch:* queues they leave behind.

Unused modules and themes report

Builds a report of unused modules and themes.

Guide maintainers

trigve hagen's picture