Some of the most effective WordPress speed improvements happen where visitors never look: inside the database. One table in particular, wp_options, is read on every single page load, and the part of it that gets loaded automatically can quietly grow over the years. This guide explains WordPress autoloaded options in plain language: what they are, how WordPress 6.6 made autoloading smarter, how to measure your site’s autoloaded data, and how to trim it safely. Whether you are a site owner who just saw a Site Health notice or a developer tuning a busy store, you will finish with a clear, practical plan.
What Are WordPress Autoloaded Options?
WordPress stores site-wide settings in the wp_options table: your site title, active plugins, theme settings, widget configuration and thousands of values saved by plugins. Each row has an autoload column. Options marked for autoloading are fetched together in one query near the start of every request by the function wp_load_alloptions(), and then kept in memory for the rest of that request.
This is a clever design. Instead of running dozens of small queries for settings that are needed on almost every page, WordPress grabs them all at once. The trade-off appears when the autoloaded set becomes large. Every page view then pays to read, transfer and unserialise that data, even when most of it is not needed for the page being viewed.
Why autoloaded data grows over time
- Settings from plugins you tried once. Many plugins intentionally keep their settings after deactivation so you do not lose configuration, which means data can remain after you stop using them.
- Large cached values. Some features store generated CSS, API responses or statistics in options.
- Transients without an expiration. On sites without a persistent object cache, transients live in
wp_options, and transients saved without an expiry are autoloaded. - Years of normal growth. A site that has been running for a decade simply accumulates settings.
None of this means anything is broken. It is normal housekeeping, much like clearing out a garage once in a while.
How WordPress 6.6 Made Autoloading Smarter
Historically the autoload column held just yes or no, and new options defaulted to yes. WordPress 6.6, released in 2024, introduced a more expressive system so that core can make better decisions on your behalf:
| Value | Meaning | Autoloaded? |
|---|---|---|
on | Explicitly set to autoload by the code that saved it | Yes |
off | Explicitly set not to autoload | No |
auto | No preference given; WordPress decides (currently loaded) | Yes |
auto-on | No preference given; WordPress decided to autoload | Yes |
auto-off | No preference given; WordPress decided not to autoload, for example because the value is large | No |
yes / no | Legacy values from older versions, still respected | Yes / No |
Two improvements stand out:
- Large options are no longer autoloaded by default. When code adds an option without stating an autoload preference, values larger than 150,000 bytes are stored as not autoloaded. Developers can adjust this threshold with the
wp_max_autoloaded_option_sizefilter. - A new Site Health check. Site Health now reports how many options are autoloaded and their combined size, and flags a critical issue titled “Autoloaded options could affect performance” when the total exceeds 800 KB.
WordPress also added a helper, wp_autoload_values_to_autoload(), which returns the list of database values that count as autoloaded (yes, on, auto-on and auto). It is the most reliable reference when writing your own queries.

How to Check Your Autoloaded Options Size
Before changing anything, measure. There are three easy ways to see where you stand.
Method 1: Site Health
Go to Tools › Site Health. If your autoloaded data is above the threshold you will see the critical notice; otherwise open the Passed tests section to find the count and total size. This is the friendliest starting point for non-developers.
Method 2: WP-CLI
If you have command-line access, WP-CLI can list autoloaded options with their sizes so the largest ones appear first:
wp option list --autoload=on --fields=option_name,size_bytes --orderby=size_bytes --order=desc --format=table
Run it with --autoload=off as well if you want to compare. If you are new to the command line, our WordPress cron and WP-CLI guide is a gentle introduction.
Method 3: SQL in phpMyAdmin or Adminer
For a detailed view, run these read-only queries. Replace wp_ with your table prefix if it is different.
-- Total size of autoloaded options
SELECT COUNT(*) AS options, ROUND( SUM( LENGTH( option_value ) ) / 1024 ) AS size_kb
FROM wp_options
WHERE autoload IN ( 'yes', 'on', 'auto-on', 'auto' );
-- The 20 largest autoloaded options
SELECT option_name, ROUND( LENGTH( option_value ) / 1024, 1 ) AS size_kb, autoload
FROM wp_options
WHERE autoload IN ( 'yes', 'on', 'auto-on', 'auto' )
ORDER BY LENGTH( option_value ) DESC
LIMIT 20;
How to read the numbers
- Under about 500 KB: generally healthy for most sites.
- Around 800 KB and above: Site Health’s critical threshold and a good reason to investigate.
- Several megabytes: a clear opportunity for meaningful gains, especially on busy or uncached pages.
Treat these as guides rather than strict lines. What matters most is understanding which options make up the total and whether they are needed on every request.
A Safe, Step-by-Step Optimization Process
Database work rewards patience. Follow these steps in order and you will avoid surprises.
Step 1: Take a full backup
Create a complete database backup first, ideally with a tested restore process. Most managed hosts offer one-click backups, and a reliable backup plugin works well too. Practise on a staging copy whenever possible.
Step 2: Identify who owns each large option
Option names usually start with a plugin or theme prefix, which makes ownership easy to spot. For each of your largest options, ask two questions: Is the plugin or theme that created it still installed and active? And does this value need to be available on every page load?
Step 3: Clean up leftovers from removed plugins
If an option belongs to a plugin you no longer use, the cleanest route is the plugin’s own uninstall process. Many plugins include an option such as “remove data on uninstall” in their settings. Reinstalling, enabling that option and then deleting the plugin lets the developer’s own cleanup code run. When that is not available and you are confident the data is unused, delete the option with WP-CLI:
wp option delete old_plugin_settings
Step 4: Stop autoloading large options that are rarely needed
Some options belong to active plugins but are only needed on specific screens. Switching their autoload flag off keeps the data intact while removing it from every page load. WordPress simply fetches it on demand the first time it is requested.
# WP-CLI
wp option set-autoload some_large_option off
# Or in PHP (WordPress 6.4+)
wp_set_option_autoload( 'some_large_option', false );
Change one option at a time and test the related feature afterwards. If a plugin updates the option and sets autoload back on, that is a sign it genuinely wants the value available early, and it is fine to respect that choice.
Step 5: Tidy up transients
Expired transients are cleaned up by WordPress over time, but you can clear them immediately with wp transient delete --expired. Transients are designed to be temporary, so features will simply regenerate them when needed.
Step 6: Measure again
Re-run your size query and revisit Site Health. Then compare server response time on a few uncached pages, for example with your browser’s developer tools or a monitoring tool. Recording before-and-after numbers makes the value of the work easy to share with clients or colleagues.
Best Practices for Developers
If you build plugins or themes, a few habits help every site that uses your code stay lean.
Choose autoload deliberately
Both add_option() and update_option() accept an autoload argument. Pass true for small settings needed on most requests, and false for large values or data used only in the admin or in background jobs:
// Small, frequently used setting.
update_option( 'myplugin_settings', $settings, true );
// Large report data used only on one admin screen.
update_option( 'myplugin_report_cache', $report, false );
Use the right storage for the job
- Per-post data belongs in post meta, not a giant option keyed by post ID.
- Temporary data belongs in transients with an expiration.
- Large or growing datasets such as logs belong in a custom table.
- Many related settings can be grouped into one small array option rather than dozens of separate rows.
Clean up after yourself
Provide an uninstall.php file or an uninstall hook that removes your options, and give users a clear choice about whether to keep data. Site owners appreciate plugins that leave the database as tidy as they found it.
Bulk changes made easy
When you need to adjust several options at once, for example during a plugin update routine, wp_set_options_autoload() and wp_set_option_autoload_values() update autoload flags efficiently in a single operation.
How Object Caching Fits In
A persistent object cache such as Redis stores the autoloaded options in memory, so the database query is skipped on most requests. That is a fantastic improvement, and our Redis object cache setup guide walks through it step by step. Object caching and a lean wp_options table work best together, though. A smaller autoload payload still means less data to fetch from the cache and unserialise on every request, and it keeps you well within any per-item size limits your cache backend may have. Memcached, for example, uses a default maximum item size of 1 MB.
With a persistent object cache, transients are also stored in the cache instead of the options table, which naturally keeps wp_options smaller.
Make It Part of Regular Maintenance
Autoload optimization is not a one-time project. A light quarterly check keeps things healthy:
- Review Site Health for the autoloaded options check.
- Run the “top 20” query and note any new large entries.
- Remove data from plugins you have retired.
- Clear expired transients.
- Record the total size so you can spot trends.
Pair this with the other checks in our WordPress security checklist, and if you are working through a full speed project, our walkthrough on cutting load time from 12 seconds to 2 shows how database tuning fits alongside caching and front-end work.
What You Will Typically Find During an Audit
Every site is different, but autoload audits tend to reveal the same handful of patterns. Knowing them in advance makes your review faster and more confident.
Core options that should stay autoloaded
Entries such as siteurl, home, active_plugins, template, stylesheet, rewrite_rules and cron are used on most requests. They are expected, and it is best to leave them as they are. A large cron option is usually a sign of many scheduled events, which our WordPress cron guide explains how to review.
Theme and builder settings
Themes and page builders often store global styles, generated CSS or layout settings in options. Many of these are genuinely needed on the front end, so treat them gently. If a value is very large, check the theme or builder settings for an option to store generated CSS in files, which is often available and usually faster.
Statistics, logs and caches
Values that store reports, logs or cached remote data are often the best candidates for switching autoload off, because they are typically needed only in the dashboard or by a background task. Test the related screens after the change to confirm everything still works as expected.
Orphaned settings
Options whose prefix does not match any installed plugin or theme are usually left over from earlier experiments. Search the prefix online or in your codebase to confirm what created it, then remove it once you are sure it is no longer used.
Working with Your Host and Your Team
Database optimization goes smoothly when everyone knows the plan. A few habits help:
- Share a short report listing the options you plan to change, who owns them and why. Clients and colleagues appreciate the transparency.
- Schedule changes for quiet hours and keep your backup close at hand.
- Ask your host for help if you do not have database access. Many managed WordPress hosts can provide autoload reports or run the queries for you.
- Purge caches afterwards, including your page cache and object cache, so the site loads the updated options right away.
- Keep a change log so anyone on the team can see what was adjusted and when.
Treating the audit as a shared, documented task turns a technical clean-up into a repeatable maintenance routine that keeps the whole site healthy.
Frequently Asked Questions
Is it safe to set every option to autoload off?
No. Small options that are used on most pages are cheaper to load together in one query. Turning them all off would cause many extra queries. Focus on large options that are rarely needed.
Why does Site Health still show a warning after cleanup?
Site Health may be showing a cached result, or an active plugin may legitimately need a large autoloaded value. Refresh the report, review the largest remaining options, and remember that the 800 KB threshold is a prompt to investigate rather than a hard failure.
Will optimizing autoloaded options improve Core Web Vitals?
It mainly improves server response time (Time to First Byte), especially on uncached pages, logged-in sessions and WooCommerce carts. Faster server responses give every other loading step a head start, which supports metrics such as Largest Contentful Paint.
Conclusion
WordPress autoloaded options are a smart performance feature that simply needs occasional attention. Thanks to the improvements in WordPress 6.6, core now avoids autoloading large values by default and tells you in Site Health when your total grows. By measuring first, backing up, cleaning leftovers, switching off autoload for large rarely used options and building good habits into your own code, you can keep wp_options lean and give every page load a faster start.
References and Further Reading
- Options API: Disabling autoload for large options – Make WordPress Core
- WordPress 6.6 Performance Improvements – Make WordPress Core
- Optimization – WordPress Advanced Administration Handbook
- wp option commands – WP-CLI documentation
Images: Tyler on Unsplash.

Leave a Reply