Duplicator Documentation

Documentation, Reference Materials, and Tutorials for Duplicator

Cleaning Up Your Database


The Cleanup tab is where you clear out the clutter that builds up in your WordPress database. This guide walks through what each item is, what’s safe to remove, and how to run a cleanup.


The short version

WordPress holds on to a lot of data you rarely need: old post revisions, expired cache entries, trashed comments, and more. The Cleanup tab shows you how much of each kind you have and lets you clear it all in one go.

Please read this: Cleanup permanently deletes whatever you select. There’s no undo button inside the plugin. Always take a backup first. See Back Up Before You Clean.

What you can clear out

DB Optimizer handles nine kinds of data. Here’s what each one is, in plain terms, and whether it’s generally safe to remove.

ItemWhat it actually isSafe to remove?
Post revisionsOlder saved versions of your posts and pages.Yes. Clearing them doesn’t change a single thing on your live site. Recent ones are protected by your retention window anyway.
Auto-draftsThe blank drafts WordPress creates the moment you start a new post.Yes. These are almost always abandoned empty drafts.
Trashed postsPosts and pages sitting in your trash.Yes, once you’re sure you don’t want them back. This empties the trash for good.
Trashed commentsComments you’ve moved to the trash.Yes, if you’re not planning to restore them.
Spam commentsComments flagged as spam.Yes.
Expired transientsTemporary cached values (the regular and site-wide kind) that have already expired.Yes. WordPress rebuilds anything it still needs.
PingbacksAutomatic notes from other sites that linked to yours.Yes, if you don’t use them.
TrackbacksAn older style of cross-site link notification.Yes, if you don’t use them.
oEmbed cacheSaved embed data for things like tweets and videos.Yes. It’s rebuilt the next time that embed loads.

How your recent data stays safe

DB Optimizer keeps a “keep last X days” window (7 days out of the box) on every cleanup. Anything newer than that window won’t be deleted, even if you tick its box. That’s there to protect the revision you saved this morning or the post you trashed yesterday in case you change your mind. You can adjust the window in Settings. See Configuring the Retention Window.

Running a cleanup

  1. Take a backup first. (Back Up Before You Clean.)
  2. Open DB Optimizer » Cleanup.
  3. Check the count next to each item. It only counts items that are actually eligible to go once your retention window is applied.
  4. Tick the items you want to clear, or hit Select All. Anything showing a count of zero is skipped for you.
  5. Click the cleanup button and read the confirmation box. It tells you what you’re about to do and reminds you the deletion is permanent.
  6. Confirm. When it’s done, the counts and the on-screen message update to show exactly what got removed.

A few things worth knowing

  • Big cleanups run in batches. Each item type only fetches so much per run, so the request stays quick even on large sites. If a huge count doesn’t fully clear the first time, just run it again to finish the job.
  • Counts can shift a little. New items can show up between the moment you see a count and the moment you click clean. The final message always reflects what was really removed.
  • Empty items are skipped. If there’s nothing to clear for a particular type, Select All leaves it out.

Was this article helpful?


Related Articles

Don't Let Another Day Pass Unprotected

Every hour without proper WordPress backups puts your site at risk • Every delayed WordPress migration costs you performance and growth

Get Duplicator Now
Duplicator Plugin

Wait! Don't miss your
exclusive deal!

As a customer, you get 60% OFF

Try Duplicator free on your site — see why 1.5M+ WordPress pros trust us. But don't wait — this exclusive 60% discount is only available for a limited time.

or
Get 60% Off Duplicator Pro Now →