WordPress
The Cleanup Nobody Does
Last updated:
What accumulates
- Post revisions — every save, retained forever by default
- Transients — temporary data that is not always cleaned up
- Orphaned meta from plugins that were removed
- Spam comments, if comments are enabled
- Autoloaded options, loaded on every single page request
Autoloaded options are the important one
Every autoloaded option is read on every page load. A plugin storing large data as an autoloaded option slows every request on the site, invisibly.
Checking the total size of autoloaded options is a five-minute diagnostic that occasionally finds a dramatic problem.
Limit revisions
Unlimited revisions on a page edited weekly for three years is hundreds of rows nobody will ever look at.
Limiting to the last ten is sensible for most sites and takes one line of configuration.
Cleaning up safely
- Back up before any database cleanup, without exception
- Use an established tool rather than hand-written queries
- Do it on staging first if the site is large
- Do not delete data from plugins you still use
When it actually matters
| Site | How much this matters |
|---|---|
| New, few plugins | Very little |
| Five years old, many plugin changes | Considerably |
| Store with high order volume | Significantly — order tables grow |
| High-traffic content site | Moderately |
Frequently asked questions
Will cleanup break anything?
Not if done with an established tool and a backup. Hand-written deletions without a backup are where things go wrong.
How often should we do it?
Annually for most sites. Quarterly for busy stores where order data accumulates quickly.
Does database size affect speed?
Size less than structure. Autoloaded options and unindexed queries matter far more than total size.
Should we use an optimisation plugin?
For cleanup, yes, run occasionally. Leaving one running constantly is unnecessary overhead.
Admin area getting slower every year?
Often the database. A five-minute check tells you whether that is it.