Every page request pulls a set of options out of the database before it renders anything. Years of plugins, themes and abandoned settings pile up in there, and nobody looks.
Cleaning it is not dramatic. It is twenty minutes with a terminal and a backup, and the site usually responds a little faster afterwards.
What Loads On Every Request
WordPress fetches every option marked for autoload in one query at the start of each request, whether or not anything uses it.
That is the design, and it is a good design when the list is small. It stops being good when a plugin that wrote a large option ten years ago is still on the list and no longer installed.
Revisions Nobody Reads
Every save creates a revision, and long-lived posts accumulate dozens of them.
They are not free. They are rows in the posts table with their own meta, and an old blog with a thousand posts can carry tens of thousands of revisions nobody will ever restore.
Some sites keep them deliberately. Most are holding a decade of intermediate drafts of articles that were published in 2016.
Transients That Never Expire

Transients are cached values with a shelf life, and they live in the options table too.
Expired ones are supposed to clean themselves up. On a busy site with a broken cron, they do not, and you end up with thousands of rows that will never be read again.
Orphaned Meta From Deleted Plugins
Every plugin that stored data in post meta left rows behind when it was deleted, and nothing in WordPress associates those rows with a plugin that no longer exists.
You cannot tell by name which rows are orphaned. You can tell by whether the post they point at still exists — which catches the worst of it, and is a cheap check.
The Commands To Check It
Start with a backup, always.
wp db export before-cleanup.sql
Then look before you delete anything.
wp post list --post_type=revision --format=count
wp transient list --format=count
Two numbers, and both are usually larger than the owner expects.
For the options table, check which values the autoload column actually holds on your site first.
SHOW COLUMNS FROM wp_options LIKE 'autoload';
Older sites hold yes and no. Newer ones hold on, off and auto, and the exact set shifts between versions, so group the values before filtering them.
On the test site I checked, running WordPress 7.1.5, the column held on, off and auto, and not one row said yes. A query written for yes returns zero rows, which looks exactly like a clean bill of health.
SELECT COUNT(*) AS opts, ROUND(SUM(LENGTH(option_value))/1024) AS kb
FROM wp_options WHERE autoload NOT IN ('off','auto-off');
Orphaned meta, as a count before you touch it.
SELECT COUNT(*) FROM wp_postmeta pm
LEFT JOIN wp_posts p ON p.ID = pm.post_id
WHERE p.ID IS NULL;
A worked example, from a young site with four published posts: 177 options in total, 136 of them loading on every request for 51 kilobytes, six revisions, eight transients, and no orphaned meta at all. The single largest row was a transient holding generated block CSS at 23 kilobytes.
That is what healthy looks like when a site is new. A blog running for a decade will show much larger numbers from the same three queries, and the gap between the two is the entire reason to look.
Clean It Carefully
Now the part that matters, because all of this is reversible only with that backup.
wp transient delete --expired
wp post delete $(wp post list --post_type=revision --format=ids) --force
wp db optimize
Delete revisions only if you do not use them. If you want a sane limit instead of zero, define WP_POST_REVISIONS in wp-config.php and let WordPress manage it.
Deleting orphaned meta with a query is fine, and it is also the one step where a typo removes content rather than cache. Run the count query first, run it inside a transaction if your client supports it, and check the site afterwards.
Tools Instead Of A Terminal
Everything above has a plugin equivalent, and none of it needs shell access.
Back up first. All-in-One WP Migration exports files, database and media into a single archive you can download and re-import. The free version is limited by your host’s PHP settings rather than by the plugin, so a large site can hit the upload and post size limits. Their Unlimited Extension is 69 dollars a year for up to fifty sites if you need to override those.
UpdraftPlus is the other sensible choice, and its free tier does scheduled backups to remote storage. Either one, before you delete anything.
Clean up. WP-Sweep covers almost exactly the list above: revisions, auto drafts, transients, orphaned post, comment, user and term meta, with a count beside each item before you delete it. WP Reset is better known for resetting sites, but its partial tools include deleting transients, and its snapshots are what make touching a live database survivable.
Pick one cleaner, not three. They overlap heavily, and running all of them is how a backup plugin ends up clearing transients another plugin just wrote.
Host snapshots are the third option, and only if your plan includes them. cPanel and similar panels offer a full account backup on many hosts, while plenty of cheap plans give you the WordPress install and nothing else. A host snapshot is also not a file you can carry to another host, so it complements an export rather than replacing it.
Key Takeaways
- Autoloaded options load on every request, installed or not.
- Revisions and expired transients are rows you are paying for.
- Orphaned post meta survives every plugin you delete.
- Check the autoload column before trusting a query from a tutorial.
- Export the database first. Everything after that is undoable.

























