WordPress Database Optimization: What to Clean and What to Leave Alone
A cautious guide to revisions, transients, tables and query performance.
Short answer: Database cleanup can remove accumulated housekeeping data, but deleting rows is not the same as fixing slow queries. Back up first, understand what a plugin owns, and use profiling when query performance is the real problem.
A smaller database is not automatically a faster frontend if pages are already served from a full-page cache.
Back up first
A smaller database is not automatically a faster frontend if pages are already served from a full-page cache.
The admin area and uncached requests are more likely to expose database inefficiency.
- Change one important variable at a time.
- Compare repeatable behavior rather than one isolated score.
- Keep reliability and maintainability ahead of marginal benchmark gains.
Revisions and autosaves
The admin area and uncached requests are more likely to expose database inefficiency.
Never drop an unfamiliar table just because it appears unused.
- Change one important variable at a time.
- Compare repeatable behavior rather than one isolated score.
- Keep reliability and maintainability ahead of marginal benchmark gains.
Expired transients
Never drop an unfamiliar table just because it appears unused.
A smaller database is not automatically a faster frontend if pages are already served from a full-page cache.
- Change one important variable at a time.
- Compare repeatable behavior rather than one isolated score.
- Keep reliability and maintainability ahead of marginal benchmark gains.
Orphaned tables
A smaller database is not automatically a faster frontend if pages are already served from a full-page cache.
The admin area and uncached requests are more likely to expose database inefficiency.
- Change one important variable at a time.
- Compare repeatable behavior rather than one isolated score.
- Keep reliability and maintainability ahead of marginal benchmark gains.
Indexes and slow queries
The admin area and uncached requests are more likely to expose database inefficiency.
Never drop an unfamiliar table just because it appears unused.
- Change one important variable at a time.
- Compare repeatable behavior rather than one isolated score.
- Keep reliability and maintainability ahead of marginal benchmark gains.
Practical decision rule
Fix the layer the evidence points to. Caching helps repeated server work; CSS and JavaScript work affect rendering and responsiveness; images and fonts affect transfer and discovery; hosting and application behavior affect origin response. Avoid solving a different problem just because a tool is popular.
Related guides
Sources and further reading
Editorial note: Product features, pricing and plan terms can change. Commercial claims are checked against current vendor documentation where cited; verify the live merchant page before purchase.