Database Optimization

Server & Hosting

The database is the memory of your website. Every text, every setting, every comment is stored there. Over the years, it accumulates clutter that is read along with every request.

The usual suspects: post revisions, of which WordPress stores an unlimited number by default. Text saved fifty times is stored fifty times in the database. Add to that orphaned entries from uninstalled plugins, expired transition dates, and spam comments.

An example from a site takeover: A site with 120 posts had a database of 380 megabytes, of which 310 megabytes were revisions and plugin remnants. After cleanup, 70 megabytes remained, and the backend response time was halved.

Spam, trash, expired transition data, and old revisions beyond the last five can be safely removed. Leave tables of unknown origin alone until it's clear which plugin requires them. And always create a backup before any cleanup, without exception.

Back to the glossary