Every single page load in WordPress runs one query that pulls in every option marked autoload = yes from the wp_options table. On a fresh install that’s a small, fast query. After a year of plugins, migrations, and page builders, it’s often not.
Checking the damage
SELECT option_name, LENGTH(option_value) AS size
FROM wp_options
WHERE autoload = 'yes'
ORDER BY size DESC
LIMIT 20;
It’s common to find abandoned plugins left behind rows several megabytes in size — page builder revision history, deactivated SEO plugin caches, or logging tables that were never cleaned up.
What’s safe to change
Anything you don’t recognize from an active plugin, and anything clearly tied to something you uninstalled, can usually be set to not autoload:
UPDATE wp_options SET autoload = 'no' WHERE option_name = 'old_plugin_settings';
Don’t touch core options like siteurl, active_plugins, or anything actively used by your theme — those need to autoload for the site to function correctly.
Transients specifically
Expired transients frequently get left behind because WordPress only cleans them up when someone actually requests that transient again. A site that’s been live for a while can accumulate thousands of dead rows:
DELETE FROM wp_options WHERE option_name LIKE '_transient_timeout_%' AND option_value < UNIX_TIMESTAMP();
DELETE FROM wp_options a WHERE a.option_name LIKE '_transient_%'
AND NOT EXISTS (SELECT 1 FROM wp_options b WHERE b.option_name = CONCAT('_transient_timeout_', SUBSTRING(a.option_name, 12)));
Always back up the database before running cleanup queries like this — it’s a five-minute step that saves a much worse afternoon if a query catches something it shouldn’t.