Plugin/Compare
Suggest a plugin

WP-Sweep

Free, settings-free database sweeper by Lester Chan that removes revisions, orphaned meta and junk using WordPress's own delete functions, with WP-CLI.

Database Optimization Verified 14 Oct 2026
Free installs100K+WordPress.org, active
Rating4.7/5138 reviews
Price fromFreeFree
Last updated24 Aug 2026Version 2.0.1

Overview

WP-Sweep is a free database cleanup plugin by Lester Chan, the developer behind WP-PostViews and WP-PageNavi. It adds a single screen under Tools that lists each type of leftover data with a count and its share of the relevant table, and you choose which sweeps to run. There is no paid version and no settings page.

How it works

The plugin’s selling point is caution: wherever possible it deletes data through WordPress’s own functions, such as wp_delete_post_revision() or delete_transient(), rather than running raw SQL. That means hooks registered by other plugins still fire, so related caches and data stay consistent. Only orphaned meta attached to object ID 0 is removed directly.

Sweeps cover revisions, auto-drafts, trashed posts, unapproved, spam and trashed comments, orphaned and duplicated post, comment, user and term meta, orphaned term relationships, unused terms, transients, oEmbed caches and a table optimise pass limited to the site’s own prefix. A Details view shows a sample of up to 500 items a sweep would remove before you commit.

Developer features

WP-Sweep is aimed squarely at people comfortable with code. Every sweep can run from WP-CLI (wp sweep –all or by name) and through authenticated REST routes, and filters let you whitelist meta keys, terms or taxonomies that other plugins store in unusual ways. The readme names several plugins, including WPML, Polylang, Elementor Popup Builder and Slider Revolution, whose data needs protecting before sweeping.

Limitations

  • No scheduling: sweeps run only when an admin starts them (or from your own cron calling WP-CLI).
  • No age or keep-last rules, so all revisions are removed.
  • No table repair, InnoDB conversion, autoload tools or leftover-table detection.
  • Version 2.0 requires WordPress 6.8 and PHP 8.2.
  • Sweeps are irreversible and there is no built-in backup.

Who should pick it: developers and maintainers who want a lightweight, hook-friendly cleaner they can script from the command line, rather than a full database management suite.

Best for: Developers who want a safe, scriptable free cleaner they can run via WP-CLI.

WP-Sweep does a narrow job carefully: it cleans the usual leftovers through WordPress's own APIs and exposes everything to WP-CLI and REST. It lacks scheduling, age rules and table tools, so non-technical users wanting automation are better served elsewhere.

Pros

  • Uses WordPress delete functions so other plugins' hooks still run
  • Full WP-CLI and REST API coverage for every sweep
  • Details view shows a sample of items before sweeping
  • Whitelist filters protect meta keys, terms and taxonomies
  • Completely free, with no settings, upsells or stored options

Cons

  • No scheduled cleanups or keep-last-X rules
  • No table repair, InnoDB conversion, autoload or orphaned-table tools
  • Protecting data from incompatible plugins requires code filters
  • Version 2.0 requires PHP 8.2 and WordPress 6.8
WP-Sweep screenshot 1 WP-Sweep screenshot 2 WP-Sweep screenshot 3

Key features

What WP-Sweep highlights on its WordPress.org page and its own website, split by version.

Free version WordPress.org

  • Revisions, auto-drafts and trashed posts
  • Unapproved, spam and trashed comments
  • Orphaned post, comment, user and term meta
  • Duplicated meta removal
  • Orphaned term relationships and unused terms
  • Transients and oEmbed caches
  • Optimise tables for this install
  • Details sample before sweeping
  • Uses native WordPress delete functions
  • WP-CLI sweep commands
  • REST API endpoints
  • Whitelist filters for meta and terms

Feature checklist

11 of 22 features we track in Database Optimization, feature score 44/100

Cleanup 5/8

Post revisions Key

Delete old post and page revisions.

Revision sweep deletes all revisions using wp_delete_post_revision().

SourceChecked 11 Oct 2026
Included

Auto-drafts & trashed posts

Remove auto-drafts and emptied trash.

Separate sweeps for auto-drafts and trashed (deleted) posts.

SourceChecked 11 Oct 2026
Included

Spam & trashed comments

Delete spam, trashed and unapproved comments.

Sweeps unapproved, spam and trashed comments.

SourceChecked 11 Oct 2026
Included

Expired transients Key

Remove expired (or all) transients.

Transient sweep clears transient options via delete_transient() and delete_site_transient().

SourceChecked 11 Oct 2026
Included

Orphaned & duplicate metadata Key

Remove post, comment, user and term meta with no parent.

Removes orphaned and duplicated post, comment, user and term meta plus orphaned term relationships.

SourceChecked 11 Oct 2026
Included

Leftover plugin tables Key

Find and delete tables left behind by removed plugins.

Does not detect or remove tables left by uninstalled plugins.

SourceChecked 11 Oct 2026
Not included

Leftover options & cron jobs

Find options and scheduled tasks left by removed plugins.

No detection of leftover options or cron events from removed plugins.

SourceChecked 11 Oct 2026
Not included

Action Scheduler logs

Clean WooCommerce Action Scheduler completed actions and logs.

No Action Scheduler cleanup sweep.

SourceChecked 11 Oct 2026
Not included
Optimisation 1/5

Optimise tables Key

Run OPTIMIZE TABLE to reclaim space and defragment tables.

Optimise sweep runs OPTIMIZE TABLE on tables with this install's prefix.

SourceChecked 11 Oct 2026
Included

Repair tables

Repair corrupted or crashed tables.

No repair function among the sweeps.

SourceChecked 11 Oct 2026
Not included

Autoloaded options control Key

See the size of autoloaded options and switch heavy ones off.

No autoload reporting or toggles.

SourceChecked 11 Oct 2026
Not included

Convert to InnoDB

Convert MyISAM tables to InnoDB.

No storage-engine conversion.

SourceChecked 11 Oct 2026
Not included

Limit future revisions

Cap how many revisions WordPress keeps from now on.

No setting to cap future revisions.

SourceChecked 11 Oct 2026
Not included
Automation & safety 2/5

Scheduled cleanup Key

Run cleanups automatically on a schedule.

Schedules no events; sweeps run manually, via WP-CLI or REST (which you could cron yourself).

SourceChecked 11 Oct 2026
Not included

Preview before deleting

Shows counts or the exact items before anything is removed.

Shows counts and a Details sample (up to 500 items by default) of what each sweep removes.

SourceChecked 11 Oct 2026
Included

Keep recent data

Keep the last X days or revisions when cleaning.

No option to keep recent revisions or items newer than X days.

SourceChecked 11 Oct 2026
Not included

Backup before cleanup

Built-in or integrated backup before running a cleanup.

No backup; the readme says sweeps are irreversible and advises backing up first.

SourceChecked 11 Oct 2026
Not included

Exclusions

Exclude specific tables, options or items from cleanup.

Code filters whitelist meta keys, term IDs and taxonomies; no admin UI for exclusions.

SourceChecked 11 Oct 2026
Partial
Insights & admin 3/4

Database size report

Shows table sizes and how much space a cleanup will save.

Shows item counts and their percentage of each table, not sizes in bytes.

SourceChecked 11 Oct 2026
Partial

Identify table & option owners

Shows which plugin or theme created each table or option.

Does not identify which plugin created tables or options.

SourceChecked 11 Oct 2026
Not included

Multisite support

Clean and optimise across a multisite network.

Runs per site; uninstall cleans the whole network but no network-wide sweep is documented.

SourceChecked 11 Oct 2026
Partial

WP-CLI

Run cleanups from the command line.

wp sweep command runs all sweeps or named ones.

SourceChecked 11 Oct 2026
Included

Pricing

Free

$0

On WordPress.org

Free

Freeper year

Unlimited

Entirely free on WordPress.org; no paid version.

Prices are list prices from the vendor's site, checked 14 Oct 2026. Many vendors discount the first year.

How many sites use WP-Sweep?

Free installs from WordPress.org, the vendor's own claim, and our estimate of paid installs.

Free version (WordPress.org) 100K+

Active installations reported by WordPress.org.

Vendor claim —

The vendor does not publish a total.

Estimated Pro / paid installs n/a

There is no paid version.

Stats & health

Weekly downloads

5,756 downloads last week, 2.3M all time

Rating breakdown

5 ★125
4 ★1
3 ★1
2 ★1
1 ★10
Version2.0.1
Last updated24 Aug 2026 (71 days ago)
Tested up toWordPress 7.1.4
RequiresWordPress 6.8+, PHP 8.2+
Support threads (2 months)1 of 1 resolved
On WordPress.org since25 Feb 2015

WP-Sweep compared

Alternatives to WP-Sweep

All alternatives →

Advanced Database Cleaner

100K+ ★ 4.9 $39/yr

Freemium WordPress database cleaner with previews, keep-last-X-days rules, scheduled tasks and table tools; Premium adds orphan detection.

89

WP-Optimize

1M+ ★ 4.8 $49/yr

Free all-in-one plugin from TeamUpdraft combining page caching, image compression with WebP, database cleanup and minification.

80

Database Cleaner

10K+ ★ 5.0 $39/yr

Meow Apps' database cleaner for large sites: core cleanup, table, option and cron browsers with ownership hints, and a Pro background sweeper.

79

LiteSpeed Cache

7M+ ★ 4.8 Free

Free server-level cache and optimisation suite from LiteSpeed Technologies; full-page caching needs a LiteSpeed web server or QUIC.cloud CDN.

44

Optimize Database after Deleting Revisions

60K+ ★ 4.7 Free

Free one-click database optimiser that deletes revisions (keeping the newest if you like), trash, spam and transients, with scheduling and multisite support.

53

WP Rocket

$59.95/yr

Premium all-in-one caching and performance plugin for WordPress that applies page caching, file optimisation and lazy loading as soon as it is…

38

FAQ

Is WP-Sweep free?

Yes. WP-Sweep has a free version on WordPress.org.

How many sites use WP-Sweep?

WordPress.org reports 100K+ active installations of the free version.

Does WP-Sweep have post revisions?

Yes: included. Revision sweep deletes all revisions using wp_delete_post_revision().

Does WP-Sweep have expired transients?

Yes: included. Transient sweep clears transient options via delete_transient() and delete_site_transient().

Does WP-Sweep have orphaned & duplicate metadata?

Yes: included. Removes orphaned and duplicated post, comment, user and term meta plus orphaned term relationships.

Does WP-Sweep have leftover plugin tables?

No: not included. Does not detect or remove tables left by uninstalled plugins.

Does WP-Sweep have optimise tables?

Yes: included. Optimise sweep runs OPTIMIZE TABLE on tables with this install's prefix.

Does WP-Sweep have autoloaded options control?

No: not included. No autoload reporting or toggles.

Does WP-Sweep have scheduled cleanup?

No: not included. Schedules no events; sweeps run manually, via WP-CLI or REST (which you could cron yourself).

Is WP-Sweep completely free?

Yes. It is a free plugin on WordPress.org with no premium version, no settings page and no upsells.

Can WP-Sweep run automatically?

Not on its own; it schedules no events. You can automate it by calling the WP-CLI command (for example wp sweep --all) from a server cron job.

Is it safe with WPML, Polylang or Elementor?

The readme lists several plugins, including WPML, Polylang and Elementor Popup Builder, whose data can look orphaned. Protect their meta keys or taxonomies with the provided whitelist filters and back up first, because sweeps cannot be undone.

What changed in version 2.0?

2.0 raised requirements to WordPress 6.8 and PHP 8.2, renamed classes, moved the admin screen URL, removed the Sweep All button in favour of a bulk action, and limited table optimisation to the site's own prefix.

Last updated 11 Oct 2026. Spotted something wrong? Suggest an edit.