Initial impact: a slow admin and a front end that looks fine
Investigation: what gets ruled out first
- Check server resources: load average, memory, swap, and disk I/O. If the server itself is starved, nothing else matters yet.
- Check PHP workers. If PHP-FPM or LiteSpeed is running out of workers, requests queue before they even start. The PHP-FPM slow log is useful here, and it is covered in this article on reading the PHP-FPM slow log.
- Deactivate plugins one at a time and switch to a default theme, watching whether admin load time changes.
The discovery: the autoloaded payload in wp_options
SQL
-- Total size of autoloaded options (replace wp_ with your table prefix)
SELECT COUNT(*) AS autoloaded_rows,
ROUND(SUM(LENGTH(option_value)) / 1024) AS autoloaded_kb
FROM wp_options
WHERE autoload IN ('yes', 'on', 'auto-on', 'auto');
-- The 20 largest autoloaded rows
SELECT option_name, LENGTH(option_value) AS bytes
FROM wp_options
WHERE autoload IN ('yes', 'on', 'auto-on', 'auto')
ORDER BY bytes DESC
LIMIT 20;Temporary mitigation: turn autoload off before deleting anything
BASH
# Measure the current autoloaded total (older WP-CLI releases use --autoload=yes)
wp option list --autoload=on --format=total_bytes
# Back up the options table (adjust the table name if your prefix is not wp_)
wp db export wp_options-backup.sql --tables=wp_optionsBASH
# Keep the row, but stop loading it on every request
wp option set-autoload old_plugin_cache_option off
# Remove expired transients only; this does not touch live ones
wp transient delete --expired