Database cleanup
Removes seven categories of accumulated database waste in one operation, so queries run against a smaller table set.
What it does
Seven kinds of waste, one operation
Database cleanup is a Vectro performance feature that removes post revisions, auto-drafts, trashed posts, spam comments, expired transients and orphaned post meta from your WordPress database in a single operation.
WordPress keeps a great deal that it never deletes. Every time you save a post it stores another full revision. Deleted posts and comments sit in the trash indefinitely. Plugins write transients with expiry times and then leave the expired rows behind. Post meta belonging to deleted posts is frequently orphaned rather than removed.
This feature clears all seven categories in one pass: post revisions, auto-drafts, trashed posts, spam comments, trashed comments, expired transients and orphaned post meta. The first six each have their own toggle, and orphaned post meta is always cleared. Revisions are the one you tune – by default it keeps the five most recent per post so you do not lose your editing history.
It removes rows that WordPress itself considers disposable. Published content, pages, media and settings are untouched.
Why it matters
A bloated wp_posts table slows every page
Revisions live in the same wp_posts table as your published content. A site with 300 posts edited a dozen times each is carrying several thousand extra rows, and every query that touches wp_posts pays a cost for them. Expired transients pile up in wp_options, a table WordPress queries on every request.
The effect is not dramatic on a small site, but it compounds. Databases get slower gradually, backups take longer, and migrations become unwieldy. Clearing rows that serve no purpose is the cheapest performance work available, because nothing has to be rewritten or reconfigured to benefit from it.
How to use it
Back up first, then run it
Technical detail
What is deleted, precisely
Vectro issues targeted DELETE statements against wp_posts, wp_comments, wp_options and wp_postmeta, scoped by post type and status so nothing outside the listed categories is affected. Revisions are ordered by date and only those beyond your retention count are removed. While Clean Post Revisions is on, Vectro also sets WordPress’s own revision limit to the same number, so posts never store more revisions than that in the first place.
Deleting rows frees them logically but does not always return disk space to the operating system, because InnoDB keeps the freed pages for reuse. Run Database optimisation afterwards if you want the file size to come down as well.
wp_options, together with their timeout rows.Compatibility
Vectro detects these and steps aside
You can override any automatic deferral from the Compatibility panel in Vectro’s dashboard if you would rather Vectro handle it.
Questions
Frequently asked
What does Vectro database cleanup remove?
Vectro database cleanup removes post revisions beyond your retention setting, auto-drafts, trashed posts, spam comments, trashed comments, expired transients and orphaned post meta. It does not touch published posts, pages, media or plugin settings.
Does Vectro database cleanup work with WP-Optimize?
Partly. If WP-Optimize is active, Vectro detects it and stops cleaning post revisions and optimising tables, leaving those to WP-Optimize. Auto-drafts, trashed posts, spam and trashed comments, expired transients and orphaned post meta are still cleared by Vectro.
How do I clean my WordPress database with Vectro?
Go to Vectro > Performance in wp-admin, set how many post revisions to keep, then click Run Cleanup Now. Take a database backup first, because the rows are deleted permanently.
Is Vectro database cleanup free or Pro?
Yes, Vectro database cleanup is free. It is included in the free Vectro plugin on WordPress.org with no account required.
Will database cleanup delete my published posts?
No – database cleanup only removes rows WordPress already treats as disposable, such as revisions, auto-drafts and trashed items. Your published posts, pages, media and settings are never affected.
Related features
Keep the database lean
Vectro Pro adds scheduled backups so your clean database is protected before every cleanup. See Pro plans
Download Vectro free on WordPress.org
27 features across Security, Performance and Maintenance. No account required, no expiry, unlimited sites.