WP-Sweep
WP-Sweep allows you to clean up unused, orphaned and duplicated data in your WordPress. It also optimizes your database tables.
The facts
- Rating
- 4.7★ from 138
- Active installs
- 100k+
- Price
- Free
- Last updated
- 24 Aug 2026
- Added
- Feb 2015
- Requires WP
- 6.8
- Tested up to
- WP 7.1
- Requires PHP
- 8.2
- Downloads
- 2,182,460
Our analysis
AI-assistedWP-Sweep is a WordPress plugin designed to clean up your database by removing orphaned and unnecessary data. It identifies and deletes items such as post revisions, unapproved comments, and orphaned metadata that are no longer needed. The plugin uses proper WordPress delete functions to ensure that any associated hooks are triggered during the cleanup process.
This plugin is suitable for users looking to optimise their WordPress database by eliminating clutter and improving performance. It is particularly useful for those who manage a site with a lot of edits or deletions over time, as it helps maintain a cleaner database environment.
Best for: This plugin suits WordPress users looking to optimise their database and remove unnecessary data.
What it does well
- ✓Removes various types of orphaned data
- ✓Uses proper WordPress delete functions
- ✓Offers a straightforward user interface
- ✓No settings screen required
- ✓Free to use from the WordPress.org directory
Where it falls short
- •Every sweep is irreversible, requiring a database backup first
- •Known incompatibilities with certain plugins
- •Limited customisation options
Verdict
WP-Sweep provides a focused solution for cleaning up a WordPress database. It is effective for users needing to manage database clutter, but caution is advised due to the irreversible nature of its actions.
From the developer
Lester Chan's own description of WP-Sweep, lightly tidied.
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
- Revisions
- Auto drafts
- Deleted posts
- Unapproved comments
- Spammed comments
- Deleted comments
- Orphaned post meta
- Orphaned comment meta
- Orphaned user meta
- Orphaned term meta
- Orphaned term relationships
- Unused terms
- Duplicated post meta
- Duplicated comment meta
- Duplicated user meta
- Duplicated term meta
- Transient options
- oEmbed caches in post meta
- Optimizes database tables
Delete functions used
wp_delete_post_revision()wp_delete_post()wp_delete_comment()delete_post_meta()delete_comment_meta()delete_user_meta()delete_term_meta()wp_remove_object_terms()wp_delete_term()delete_transient()delete_site_transient()
Known incompatibilities
These plugins keep data in places WP-Sweep reads as orphaned. Protect their meta keys with the filters under Usage before sweeping.
- Custom Fonts
- Elementor Popup Builder
- MailPress
- Meta Slider
- Polylang
- Slider Revolution
- Viba Portfolio
- WPML
Donations
I spent most of my free time creating, updating, maintaining and supporting these plugins, if you really love my plugins and could spare me a couple of bucks, I will really appreciate it. If not feel free to use it without any obligations.
Usage
Every sweep is irreversible, so back your database up first.
The screen lists every sweep with a short description of what it removes, how many items that is, and what proportion of the table they are. Tick the ones you want and use the Sweep bulk action, or use each row’s Sweep and Details buttons one at a time. Nothing on the screen needs JavaScript: the buttons are ordinary links and the bulk action is an ordinary form.
There is no settings screen. The one thing worth tuning — how many items Details lists, 500 by default — is the wp_sweep_limit_details filter. The cap exists because the whole sample is held in memory and written into the page.