Cleanup

Database cleanup — old revisions, trash and expired transients

Cleanup clears WordPress database bloat — trims old post revisions down to a set number, removes auto-drafts and trash older than a chosen number of days, and clears expired transients. Before you run anything, the screen shows a live preview of how many records will actually be affected.

Key features

  • Trims post revisions down to a configurable number kept per post
  • Removes auto-drafts and trashed posts/comments older than a chosen number of days
  • Clears expired transients — WordPress’s own temporary cache entries that often outlive their expiration
  • A live preview count of qualifying records for each cleanup type, shown before you click the button
  • Deletion always goes through proper WordPress functions (wp_delete_post_revision, etc.), never a raw SQL DELETE
  • That means attached postmeta/commentmeta is cleaned up correctly too, nothing is left orphaned

How it works

The settings screen first runs read-only queries that just count how many revisions, auto-drafts, trash items and expired transients currently qualify under the configured settings — the actual deletion only runs after confirmation.

The deletion itself calls standard WordPress functions like wp_delete_post_revision() or wp_delete_post() instead of a direct DELETE against the tables — which means core’s own related actions fire too, and postmeta/commentmeta attached to a deleted record disappears along with it instead of being left as orphaned rows.

Frequently asked questions

Can I see how much will be deleted before running it?
Yes, the settings screen shows a live preview count for each cleanup type before you click the button.
Does deletion leave orphaned meta fields behind?
No, deletion goes through standard WordPress functions, so attached postmeta/commentmeta is removed along with it.
Can I configure how many revisions stay on a post?
Yes, the number of revisions kept per post is configurable.