Popis
WordPress saves a full copy of a post every time you update it. Over months or years of editing, these copies — revisions — pile up quietly in the wp_posts table. You never see them in the post list, but they still take up database rows, slow down backups, and add weight to every migration.
Takahiro Revision Cleanup shows you exactly how many revisions exist, lets you preview what will be removed before you commit, and deletes them safely through WordPress’s own APIs. It’s a modern, actively maintained replacement for older tools such as Better Delete Revision, which was removed from the WordPress.org directory in 2022 for security issues.
See before you delete
The dashboard shows the total revision count, an estimated storage size, and a lifetime counter of everything you’ve removed so far. A paginated preview list lets you check exactly which revisions belong to which posts before running a deletion. Nothing is hidden, and published content never appears in the list.
Delete by post type, not just „everything“
Some sites only want to clean up old blog posts and leave pages untouched. Others need to target a specific custom post type. This plugin breaks revisions down by post type, including orphaned revisions whose parent post no longer exists, and lets you delete each group independently or clear everything in one pass.
Built for large sites
Deleting tens of thousands of revisions in a single PHP request is how most cleanup tools time out. Version 1.3.0 adds one-click continuous deletion: press the button once, and the plugin works through revisions in batches of 200 via AJAX, with a live progress bar so you can watch it happen. If JavaScript is unavailable, it falls back to standard form submissions automatically.
Database housekeeping, without touching the whole database
After a large deletion, wp_posts and wp_postmeta can be left with unused space. The plugin runs CHECK TABLE and OPTIMIZE TABLE on just those two tables, not a blanket optimization of your entire database.
Cleans up correctly, not just quickly
Deletion goes through WordPress’s native wp_delete_post_revision() function, so associated post meta and term relationships are cleaned up the way WordPress expects, rather than through a raw SQL DELETE that can leave orphaned data behind. A compatibility fix is also included for a known NextGEN Gallery issue during batch deletes.
Security
Revision cleanup is a destructive, irreversible database operation, so this was built with that in mind from the start:
- WordPress nonces plus a separate per-user form token on every destructive action
- Capability checks (
manage_optionsby default, filterable viatnrc_required_capability) - Rate limiting: a 30-second cooldown between destructive operations per user
- A strict allowlist restricting CHECK/OPTIMIZE to
wp_postsandwp_postmetaonly - A 2,000-revision cap per request, with a warning if more remain
- Prepared SQL statements and escaped output throughout
- An audit hook (
tnrc_security_event) for logging or monitoring integrations
What it doesn’t do
This plugin focuses on one job: reviewing and deleting revisions safely. It doesn’t include page caching, image optimization, or general cleanup of transients, spam comments, or orphaned options. If you want a single plugin that handles everything, a broader optimization suite may suit you better. If you want to see what’s in your revisions before removing them, and trust that the removal won’t touch anything else, that’s what this plugin is for.
Instalace
- Upload the
takahiro-revision-cleanupfolder to/wp-content/plugins/. - Activate the plugin through the ‚Plugins‘ menu in WordPress.
- Go to Tools > Takahiro Revision Cleanup to review and delete revisions.
Nejčastější dotazy
-
Will this delete my published posts?
-
No. Only posts with the
revisionpost type are removed. Published, draft, and scheduled content lives in a separate database record and is never touched. -
How is this different from Better Delete Revision?
-
Better Delete Revision was closed on WordPress.org in 2022 due to security issues. Takahiro Revision Cleanup follows the same core workflow (review revisions, delete them, check/optimize tables) and adds post-type filtering, a paginated preview, a lifetime counter, batch deletion with a progress bar for large sites, and security practices that meet current WordPress.org guidelines.
-
Can I undo a deletion?
-
No. Deleted revisions cannot be restored unless you have a database backup taken before the deletion. Always back up before running a large cleanup.
-
What happens to „orphaned“ revisions?
-
Sometimes a parent post is removed outside of the normal WordPress flow while its revisions remain behind. The plugin detects these orphaned revisions separately in the post-type breakdown so you can review and remove them too.
-
Will deleting thousands of revisions time out my site?
-
That’s what the progress bar in version 1.3.0 is for. Instead of one long request, deletions run in batches of 200 via AJAX, so large sites with tens of thousands of revisions can finish a full cleanup without hitting PHP execution time limits.
-
Does it work on multisite?
-
Not in the current version. Network-admin support is on the roadmap.
-
Does this plugin send any data externally?
-
No. It only reads from and writes to your own WordPress database. No external requests, analytics, or tracking of any kind.
-
Who is allowed to use this?
-
By default, only users with the
manage_optionscapability (Administrators, in a standard setup) can access the tool. This is filterable viatnrc_required_capabilityfor sites with custom role configurations.
Recenze
Pro tento plugin nejsou žádné recenze.
Autoři
Takahiro Revision Cleanup je otevřený software. Následující lidé přispěli k vývoji tohoto pluginu.
SpolupracovníciPřeložte “Takahiro Revision Cleanup” do svého jazyka.
Zajímá vás vývoj?
Prohledejte kód, podívejte se do SVN repozitáře, nebo se přihlaste k odběru protokolu vývoje pomocí RSS.
Přehled změn
1.3.0
- Add one-click continuous deletion with a live progress bar via AJAX (batches of 200); no more repeated reloads on large sites
- Gracefully fall back to standard form submits when JavaScript is disabled
- Restore Plugin URI header pointing to the plugin’s dedicated page (distinct from Author URI)
1.2.1
- Remove Plugin URI header (must differ from Author URI on WordPress.org upload)
1.2.0
- Rename plugin to Takahiro Revision Cleanup (takahiro-revision-cleanup) per WordPress.org review
- Update Author and Plugin URI to https://takahiro-nishii.com
- Remove load_plugin_textdomain() (WordPress.org hosts translations)
- Expand function prefix from crm_ to tnrc_ (4+ characters)
1.1.2
- Add centralized TNRC_Security layer (form tokens, action allowlist, rate limits)
- Strict allowlist for CHECK/OPTIMIZE TABLE (wp_posts and wp_postmeta only)
- Cap bulk deletes at 2000 revisions per request with user warning
- Validate transient notice and db_check payloads before display
- Add tnrc_security_event audit hook for monitoring integrations
- Block direct directory access via index.php stubs
1.1.0
- Add paginated revision list preview (Better Delete Revision parity)
- Add lifetime deleted revisions counter
- Add CHECK TABLE before OPTIMIZE TABLE
- Use wp_delete_post_revision() for safer meta/term cleanup
- Add NextGEN Gallery batch-delete compatibility
- Add Settings link on the Plugins screen
1.0.0
- Initial release
