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 |