Clean database by deleting orphaned data such as 'revisions', 'expired transients', optimize database and more...
- Installs
- 100,000+
- Rating
- 4.9 (2K)
- Updated
- 2 months ago
WP-Sweep allows you to clean up unused, orphaned and duplicated data in your WordPress. It also optimizes your database tables.
| Last updated | August 24, 2026Updated in the last 3 months |
|---|---|
| Tested up to | WordPress 7.1.4Covers WordPress 7.1.4, the current release |
| Needs WordPress | 6.8 or newer |
| Needs PHP | 8.2 or newer |
| First published | February 25, 2015 |
| Support, last two months | 1 of 1 threads resolved (100%) |
4.7 / 5 from 138 reviews
| 5 stars | 125 |
|---|---|
| 4 stars | 1 |
| 3 stars | 1 |
| 2 stars | 1 |
| 1 star | 10 |
WP-Sweep finds the rows WordPress leaves behind and removes them. Revisions of posts you edited years ago, meta belonging to a post that was deleted, terms attached to nothing, term relationships pointing at posts that no longer exist, expired transients: none of it is visible anywhere in wp-admin, and all of it is in your database.
It uses the proper WordPress delete functions wherever they can reach the row, rather than running raw delete queries, so the hooks other plugins rely on still fire. Only the rows the API refuses to touch — orphaned meta whose object ID is 0 — are deleted directly.
Features
Delete functions used
Known incompatibilities
The opening of the plugin's own description. The full text, installation notes and changelog are on its WordPress.org page.
It is still under Tools, but the address changed from tools.php?page=wp-sweep/admin.php to tools.php?page=wp-sweep. Update any bookmark.
The old address was the legacy “plugin file as menu slug” form, which put the plugin’s installation directory name into the page URL.
Every row has a checkbox and the table has a Sweep bulk action, so ticking the header checkbox and applying it does what Sweep All did — and lets you leave out the ones you do not want.
The classes are renamed in 2.0.0:
So WPSweep::get_instance()->sweep( 'revisions' ) becomes WP_Sweep::get_instance()->sweep( 'revisions' ). There is no compatibility alias, so the old name raises a fatal error rather than failing quietly.
Every filter and every wp_sweep_admin_*_sweep action keeps the name it had.
Four per-type filters take a list of meta keys that must never be deleted, and each supports * as a wildcard:
add_filter( 'wp_sweep_postmeta_whitelist', function ( $keys ) { $keys[] = '_my_plugin_setting'; $keys[] = '_acme_*'; return $keys; } );
Before 2.0.0 the exclusion was a SQL LIKE clause, and LIKE treats an underscore as a single-character wildcard. A pattern of _my_key therefore also matched Xmy!key, and a good deal else. Matching happens in PHP now, so an underscore is an underscore and only * is a wildcard. Check your list if you were relying on the old behaviour.
Nothing. WP-Sweep stores no option rows, creates no database tables, registers no capabilities and schedules no events. uninstall.php runs anyway and sweeps up after itself across a whole network rather than the first hundred sites.



Clean database by deleting orphaned data such as 'revisions', 'expired transients', optimize database and more...
#702 by installs
Manages your WordPress database.
#5 by installs
All-in-one unbeatable acceleration & PageSpeed improvement: caching, image/CSS/JS optimization...
#47 by installs
The simplest and fastest WP Cache system
#73 by installs
Search Engine (SEO) & Performance Optimization (WPO) via caching. Integrated caching: CDN, Page, Minify, Object, Fragment, Database support.
#77 by installs
Autoptimize speeds up your website by optimizing JS, CSS, images (incl. lazy-load), HTML and Google Fonts, asyncing JS, removing emoji cruft and more.
Read from the WordPress.org plugin API on , when WordPress 7.1.4 was the current release. WordPress.org rounds active installs into buckets. These are the directory's figures, not my verdict, and I haven't tested this plugin. The author takes donations at their donate page.