If your WordPress site’s time-to-first-byte has crept up over the past year and nothing in the front-end explains it, the cause is usually autoloaded options. The wp_options table grows quietly until one day every page request is hauling 2MB of data into memory before WordPress can render a thing. Here is how to find that bloat and safely remove it.

Why autoload matters

Every WordPress request loads all options where autoload = 'yes' into memory. That set should be a few hundred KB on a healthy site. On a neglected site it can grow to tens of MB — old plugin transients that did not clean up, abandoned plugin settings, error logs stuffed into an option row.

How to measure

Run this in wp-cli or phpMyAdmin:

SELECT
  SUM(LENGTH(option_value)) / 1024 / 1024 AS autoload_mb,
  COUNT(*) AS rows
FROM wp_options
WHERE autoload = 'yes';

Anything over 1MB is worth looking at. Anything over 5MB is hurting TTFB. We have seen 40MB on a five-year-old site.

Find the worst offenders

SELECT option_name, LENGTH(option_value) AS size
FROM wp_options
WHERE autoload = 'yes'
ORDER BY size DESC
LIMIT 30;

The top of that list almost always shows three categories:

  • Transients that should not have been autoloaded
  • Plugin “stats” or “history” rows from plugins that no longer exist
  • Cache rows from defunct cache plugins

How to remove safely

  1. Back up first. Always.
  2. Identify orphans. Options whose owning plugin is no longer installed are safe to delete. The option-name prefix usually identifies the plugin.
  3. For options whose plugin is still installed, set autoload = 'no' instead of deleting. The plugin can still read them on demand; they just do not load on every request.
  4. Run wp transient delete --all to clear the transient cruft.

Example impact

On a site with 18MB of autoloaded options, the cleanup dropped TTFB from 1.4s to 480ms — no other changes. The autoload table went from 18MB to 380KB. Almost all the savings came from one defunct backup plugin’s history table left over from a 2019 install.

What to do this afternoon

Run the first query above. If your autoload_mb is over 1, schedule a 30-minute cleanup. If it is over 5, do it today. This is the single highest-leverage TTFB optimisation on most older WordPress sites and it has nothing to do with caching.