Database Cleanup

Clean up post revisions, trash, spam, expired transients, and orphaned metadata.

Last updated Feb 6, 2026

Why Database Cleanup Matters

Over time, WordPress databases accumulate bloat: old post revisions, trashed posts, spam comments, expired transients, and orphaned metadata. This increases database size, slows queries, and can impact page load times.

BoostPro provides both manual and scheduled cleanup to keep your database lean.

Cleanup Categories

Post Revisions

WordPress saves a revision every time you update a post. A post edited 50 times has 50 revisions in the database. BoostPro lets you set a maximum number of revisions to keep per post.

  • Default limit: 5 revisions per post
  • Range: 0 (keep all) to 100
  • What's deleted: Oldest revisions beyond the limit, plus their associated postmeta entries

Tip

5 revisions is a good balance. It's enough to undo recent changes while preventing database bloat. Set to 0 only if you never want revisions deleted.

Trashed Posts

Posts and pages you've moved to the trash remain in the database until permanently deleted. Cleanup removes all trashed posts and their associated metadata.

Spam Comments

Comments flagged as spam stay in the database until you manually empty the spam folder. This can be thousands of entries on a site that receives regular spam.

Expired Transients

Transients are temporary cached data stored in the options table. They're supposed to expire automatically, but expired transients often linger. Cleanup removes transients that have passed their expiration time.

Orphaned Metadata

When a post is deleted, its metadata entries in wp_postmeta sometimes remain. These orphaned rows serve no purpose and waste space. Cleanup identifies and removes metadata entries with no parent post.

Manual Cleanup

To run a one-time cleanup:

  1. Go to BoostPro → Cleanup
  2. Review the item counts for each category
  3. Click Run Cleanup
  4. The cleanup runs and reports how many items were removed

Item counts are refreshed via AJAX before each cleanup so you see current numbers.

Scheduled Cleanup

For hands-off maintenance, enable scheduled cleanup to run automatically on a recurring basis.

  • Default: Off
  • Frequency options: Daily, weekly, or monthly
  • Recommendation: Weekly is a good balance for most sites

When enabled, BoostPro registers a WordPress cron event that runs all cleanup categories at the selected frequency.

Important

Scheduled cleanup runs all categories (revisions, trash, spam, transients, orphaned meta) using your configured revision limit. Make sure your revision limit is set correctly before enabling scheduled cleanup.

Database Statistics

The Cleanup tab displays real-time counts for each category:

  • Revisions: Number of revisions that exceed your keep limit
  • Trash: Number of trashed posts
  • Spam: Number of spam comments
  • Transients: Number of expired transients
  • Orphaned Meta: Number of orphaned postmeta entries

Best Practices

  • Back up first: Before running your first cleanup, create a database backup
  • Start with manual: Run a manual cleanup first to see the impact before enabling scheduled cleanup
  • Keep some revisions: Don't set the limit to 0 unless you have a separate backup strategy
  • Weekly is ideal: Monthly lets too much bloat accumulate; daily is unnecessary for most sites