RevealTheme logo
Back to Blog

WordPress Bloated WP_Options: How To Find And Fix It

WordPress Bloated WP_Options: How To Find And Fix It
The RevealTheme Team

By

··Updated May 27, 2026·5 min read

WordPress's wp_options table stores site-wide configuration. Each option is a key-value pair, and options marked as "autoload=yes" get loaded into memory on every WordPress page request. Over time, the autoloaded portion of wp_options accumulates entries from plugins, themes, and abandoned features.

The bloat isn't immediately visible. Pages still render correctly. But each request loads more data into memory than needed, and at high request volume the overhead compounds into measurable performance impact.

The mechanism

WordPress's get_option() function checks an in-memory cache first. If the option isn't cached, it queries the database. To avoid repeated database queries for common options, WordPress loads all autoloaded options into memory at the start of each request.

The autoload mechanism is fast for small option counts. For sites with 100-200 autoloaded options totaling under 1MB, the load is fast and the cache hit rate is high.

For sites with 500+ autoloaded options or autoloaded data totaling 5MB+, the initial load itself takes measurable time. Memory pressure increases. The cache hit rate is still high but the cache itself is heavier.

The symptoms of bloat

Slow TTFB on cache-miss pages. The first request to a page (before page cache fills) takes longer because more data loads at request start.

Slow admin dashboard. The dashboard makes many database queries; the option load overhead compounds.

Memory pressure on shared hosting. WordPress's memory limit might be exceeded by the option load plus normal page processing.

Slow Cron processing. Scheduled tasks pay the option load cost on each run.

The diagnostic sequence

Step 1: query the total size of autoloaded data.

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

Acceptable values: under 1MB. Concerning: 1-5MB. Problematic: over 5MB.

Step 2: find the largest autoloaded options.

SELECT option_name, LENGTH(option_value) / 1024 AS size_kb
FROM wp_options
WHERE autoload = 'yes'
ORDER BY LENGTH(option_value) DESC
LIMIT 20;

The query lists the 20 largest autoloaded options. Review the list for: options that obviously shouldn't be autoloaded, options from plugins you no longer use, options with values much larger than they should be.

The common bloat sources

Plugin transients with autoload=yes. Some plugins set transients (timed cache entries) with autoload, which defeats the purpose of transients (they should be cheap to access on demand). Cleanup: identify transient-named options (typically prefixed with _transient_) that are autoloaded; set their autoload to 'no'.

Abandoned plugin options. Plugins that were uninstalled but didn't clean up their options. The options remain in the database but no longer do anything. Cleanup: identify options from uninstalled plugins (compare option_name prefixes to active plugins); delete them.

Large serialized arrays. Some plugins store large datasets (cache data, user lists, custom settings) in single option values. The option might be 500KB by itself. Cleanup depends on the plugin: ideally the plugin should store this data in custom tables, not in wp_options.

WooCommerce session data with autoload. WooCommerce stores some session-related data in wp_options. Modern WooCommerce versions handle this correctly, but legacy data might still have autoload=yes inappropriately.

Theme options that grew over time. Some themes store extensive customizer settings in options. A heavily-customized theme might have multi-megabyte option values.

The cleanup approach

For each problematic option, decide: delete (if the option is genuinely unused), change autoload to 'no' (if the option is rarely accessed and doesn't need to be in memory always), or refactor (if the plugin should be using a different storage mechanism).

For abandoned plugin options:

DELETE FROM wp_options WHERE option_name LIKE 'plugin_prefix_%';

Verify the plugin is actually uninstalled and not just deactivated before deleting its options.

For autoload corrections:

UPDATE wp_options SET autoload = 'no' WHERE option_name = 'specific_option_name';

This keeps the option available but stops it from being loaded on every request.

Always back up before deleting. Recovery from a wrong deletion is harder than the deletion itself.

The plugins that help

Advanced Database Cleaner (free + paid versions) identifies autoload bloat and offers cleanup. The plugin shows the largest options, suggests cleanup actions, and handles the cleanup safely.

WP-Optimize includes autoload analysis as part of its broader database cleanup features. Similar functionality with broader scope.

Query Monitor (free) is a development tool that shows what's slow on each page load. It can reveal whether option loading is contributing to slow pages.

The ongoing maintenance

Autoload bloat accumulates over years. The maintenance discipline: quarterly check of total autoload size and largest options. Address growth before it becomes problematic.

For plugin uninstalls, check whether the plugin cleaned up its options. If not, do the cleanup manually. The five minutes during uninstall prevents long-term bloat.

The pattern that prevents bloat: every plugin that gets installed gets evaluated for its option behavior over a few weeks. Plugins that aggressively bloat options should be replaced with alternatives that don't.

The measurement of improvement

After cleanup, measure: TTFB on a representative uncached page (should improve by 50-200ms if cleanup was significant), admin dashboard load time (should improve noticeably), total autoload size (should be much smaller).

The improvement is sometimes dramatic on sites that had accumulated years of bloat. A site that went from 8MB autoload to 1MB autoload sees substantial TTFB improvement on every uncached request.

The honest framing

Autoload bloat is a quiet performance problem. It doesn't break sites; it just makes them slower than they should be. Many sites have the problem and don't know it.

The diagnostic and cleanup take a few hours of focused work. The results compound across every page load for as long as the site runs.

The discipline that prevents recurrence: regular checks, plugin selection that respects option storage patterns, immediate cleanup after plugin uninstalls. The work is small but ongoing.

For sites where performance matters, autoload management is a fundamental part of database hygiene. Skipping it leaves performance on the table that no amount of caching or CDN can fully recover.