Autoloader
Optimizer
How WP Multitool identifies and safely optimizes autoloaded options — with zero false positives.
The Problem: WordPress Autoload Bloat
Every single time WordPress handles a request — whether a page view, admin screen, or API call
— it loads all options marked as autoload into memory. This is by design: the
wp_options table can grow unbounded, and WordPress caches autoloaded options early in the
bootstrap process to avoid dozens of separate database queries.
In theory, this is efficient. In practice, autoloaded options bloat over time.
Why Autoload Grows Unchecked
When you install a plugin, it often creates options to store settings. Many plugins mark their options
as autoload = 'yes' (the default). So far, so good.
The problem: when you deactivate a plugin, its options stay in the database. They remain marked as autoload. The plugin isn't running anymore, so those options serve no purpose. Yet WordPress still loads them into memory on every single request.
Over months and years, a WordPress site accumulates options from:
- Plugins you installed and then deactivated (never cleaned up)
- Plugins you deleted entirely but left database rows behind
- Inactive themes
- Abandoned features or A/B test configurations
- Cache tables, tracker data, and analytics from both current and past plugins
Real-World Impact
Every request, that data is loaded from the database, unserialized from PHP serialized format, held in memory for the entire request, then discarded. This happens whether or not any code actually uses those options. It is pure waste.
On high-traffic sites, this translates to slower page load times (5–30% in some cases), increased database load, higher memory consumption on the web server, and cumulative effects on crawl performance and user experience.
How the Autoloader Optimizer Works
The Autoloader Optimizer analyzes your site's autoloaded options and recommends safe optimizations. It classifies every option into categories, identifies candidates for optimization, and provides a restore mechanism in case anything goes wrong.
- Health Check — Scans every autoloaded option and classifies it into one of six categories
- Plugin Detection — Uses WordPress metadata (TextDomain + folder name) to match options to plugins with high accuracy
- Learning Mode — Optional observation period tracks which options are actually accessed before making changes
- Optimization — Creates a backup, then disables autoload on flagged candidates. No data is ever deleted.
Step 1: Health Check — The Six Categories
The health check scans every autoloaded option in your wp_options table and places
each one into one of six categories.
1. Safe Options
These are WordPress core options that must never be touched. They're matched against a curated
safe-options list that includes site metadata (siteurl, home,
blogname), reading settings, plugin/theme records (active_plugins,
template, stylesheet), and core caches (alloptions,
notoptions). These are never flagged for optimization.
2. Active Plugin Options
Any option whose prefix matches a currently active plugin is treated as essential to keep
autoloaded. The module uses WordPress's get_option('active_plugins') to determine
which plugins are running, then matches option prefixes to those plugins.
Example: The plugin wordpress-seo is active. Any option starting with
wordpress_seo_ or wpseo_ is flagged as belonging to an active plugin
and protected.
3. Inactive Plugin Options (Optimization Candidates)
These are options whose prefix matches an installed but deactivated plugin. Since the plugin isn't running, these options serve no purpose and can safely have their autoload flag disabled.
Example: You installed Elementor, used it for a while, then deactivated it. The
elementor_ prefixed options remain in your database and are still autoloaded on
every request. The Autoloader Optimizer identifies these and recommends disabling their autoload.
4. Oversized Options
Individual option values larger than 10KB are flagged, regardless of their source or active status. Large serialized arrays or cached data that are autoloaded on every request are an obvious performance drain. Common culprits include cron job schedules, widget configurations from page builders, transients stored as options, and cached API responses.
5. Bloat Patterns
Certain option prefixes are known indicators of data that should never be autoloaded. The module maintains a curated list of these patterns. These patterns apply regardless of whether the associated plugin is currently active or not — the analysis checks for bloat first, before considering plugin active status.
| Pattern | Source | Why It Shouldn't Autoload |
|---|---|---|
action_scheduler_* |
WooCommerce Action Scheduler | Job queue data, not needed on every request |
wc_tracks_* |
WooCommerce | Telemetry and analytics data |
elementor_* |
Elementor | Builder caches and temporary data |
_jetpack_* |
Jetpack | Cached sync and module data |
wpseo_* / aioseo_* |
Yoast SEO / AIOSEO | SEO plugin temporary and cached data |
rank_math_* |
Rank Math | Module caches and analytics |
6. Unrecognized Options
Any option that doesn't match a WordPress core prefix, an active plugin prefix, an inactive plugin prefix, or a known bloat pattern falls into the "Unrecognized" category. These might be options from your active theme, must-use plugins, custom code, or deleted plugins that didn't follow standard naming conventions.
The Autoloader Optimizer never automatically optimizes unrecognized options. We display them for your information, but we don't touch what we can't verify. You may investigate and manually optimize them if you're confident they're safe.
Step 2: Plugin Detection — How Prefixes Work
The hardest part of option analysis is correctly identifying which plugin created which option.
The module uses WordPress's get_plugins() API to retrieve all installed plugins
with their full metadata, including TextDomain.
Generating Prefixes
For each plugin, we generate multiple possible prefixes:
- Folder-based prefix — The plugin folder name with underscores (e.g.,
advanced-cachingbecomesadvanced_caching_) - TextDomain prefix — The plugin's declared TextDomain, if different from the folder name
This dual-prefix approach handles common WordPress naming patterns where the folder uses dashes and the TextDomain uses underscores, or vice versa.
Before v1.1.18: The Prefix Problem
Previous versions generated prefixes based only on folder names and created short abbreviations
by convention. For example, Fluent Forms (folder: fluentform) might have been
abbreviated as ff_ — a common abbreviation used by many other plugins. This
was a major source of false positives that could break plugin functionality if the module
misidentified active plugin options as orphaned.
After v1.1.18: TextDomain-Based Detection
The current implementation solves this by:
- Reading the full plugin metadata, including the declared TextDomain from the plugin header
- Using both the folder name and the TextDomain to generate prefixes
- Verifying the plugin's active status against WordPress's official
active_pluginslist - Only classifying an option as "inactive plugin" if we're very confident the plugin is actually inactive
This dramatically reduces false positives. We now correctly identify that Yoast SEO (folder:
wordpress-seo, TextDomain: wordpress-seo) matches
wordpress_seo_, wordpress-seo_, and wpseo_ variants by
checking plugin headers. The result: we almost never accidentally flag active plugin options
as orphaned.
Step 3: Learning Mode (Optional Deeper Analysis)
For advanced users who want data-driven optimization recommendations, the module offers an optional Learning Mode:
- Tracking period — Run the module in observation mode for a configurable period (default: 7 days)
- Access patterns — The module logs which options are actually read during admin vs frontend requests
- Frequency analysis — Track how often each option is accessed
- Size-weighted scoring — Combine frequency and option size to calculate optimization priority
- Recommendations — Options that are never accessed and large are highest priority for optimization
This is particularly useful for sites with complex, custom setups where you want to be very confident before making changes.
Step 4: Optimization
Once you've reviewed the analysis and identified candidates, the module applies the optimization:
- Backup creation — A complete backup of the options table is created and stored as an option in the database
- Autoload flag update — For each selected candidate, the
autoloadcolumn is set from'yes'to'no' - Verification — The module displays a summary of what changed
- Monitoring — After optimization, you can monitor whether the site still functions correctly
The options remain in your database. They're just not loaded into memory on every request anymore. When a plugin requests them, WordPress will load them on-demand using a separate query. There's a small performance cost for that individual request, but it's vastly outweighed by the savings of not loading them on every request.
Category Reference
Quick reference for the main optimization categories:
| Category | What It Means | Action | Risk Level |
|---|---|---|---|
| Inactive Plugin | Plugin is installed but deactivated. Options exist but aren't being used. | Disable autoload | Very low — plugin isn't running |
| Oversized | Individual option value >10KB being loaded on every request | Disable autoload | Low — option still accessible on-demand |
| Bloat Patterns | Known cache/tracker prefixes that shouldn't autoload | Disable autoload | Very low — patterns are well-understood |
| Unrecognized | Unknown origin — might be theme, deleted plugin, or custom code | None (informational only) | N/A — we don't touch what we can't identify |
Safety Measures
The Autoloader Optimizer is built with several layers of safety:
Safe Options List
A curated list of WordPress core options that are never flagged for optimization. This protects essential WordPress functionality regardless of size or origin.
Prefix-Based Plugin Matching
Uses WordPress's official plugin metadata (TextDomain, folder name) to identify which plugin
owns which option. Matched against the official active_plugins list to avoid false
positives.
Conservative Categorization
If there's any doubt about an option's origin or safety, it's placed in the "Unrecognized" category rather than being flagged for automatic optimization.
Backup Before Optimization
A complete snapshot of all autoload options is created and stored in the database before any changes are made.
One-Click Restore
If anything goes wrong, you can restore the backup with a single click. All autoload settings revert to their previous state.
Developer Filter Hook
Developers can register custom options that should never be autoload-disabled. Use the
wpmultitool_autoload_candidates filter to modify the candidates list before
optimization is applied:
add_filter('wpmultitool_autoload_candidates', function($analysis) {
// Protect specific options from being optimized
$analysis['candidates'] = array_diff($analysis['candidates'], [
'my_critical_option',
'another_important_one',
]);
return $analysis;
});
Even if an option matches a bloat pattern or comes from an inactive plugin, the filter allows you to exempt it from optimization.
Data Preservation
Options are never deleted. Only the autoload flag is modified. The data remains fully accessible to plugins and code that request it.
Developer Hooks
wpmultitool_autoload_candidates
The wpmultitool_autoload_candidates filter is called before optimization is applied.
It receives the full analysis array and must return the modified analysis:
add_filter('wpmultitool_autoload_candidates', function($analysis) {
// Structure of $analysis:
// 'candidates' => array of option names flagged for optimization
// 'safe' => array of protected core options
// 'active_plugins' => array of active plugin prefixes
// 'inactive_plugins'=> array of inactive plugin prefixes
// 'oversized' => array of large options
// 'bloat_patterns' => array of matched bloat options
// Example: Protect a specific option
if (in_array('my_custom_option', $analysis['candidates'])) {
$analysis['candidates'] = array_diff(
$analysis['candidates'],
['my_custom_option']
);
}
return $analysis;
});
Monitoring and Troubleshooting
After Optimization: What to Monitor
- Page load times — Use Google PageSpeed or WebPageTest to measure before/after
- Database queries — Check your slow query log for any new slow queries
- Functionality — Test critical user workflows (checkout, forms, admin operations)
- Error logs — Watch
wp-content/debug.logfor any new warnings or errors
If Something Breaks
- Go to WP Multitool → Autoloader Optimizer → Status
- Click "Restore Backup"
- All autoload flags revert to their previous state
- Investigate which optimization caused the issue
- Use the Developer Filter Hook to protect that specific option
- Re-apply optimizations without the problematic option
Measuring Your Autoload Size
-- Before optimization (check current autoloaded size)
SELECT SUM(CHAR_LENGTH(option_value)) AS autoload_bytes
FROM wp_options
WHERE autoload IN ('yes', 'on');
-- After optimization (verify the reduction)
SELECT SUM(CHAR_LENGTH(option_value)) AS autoload_bytes
FROM wp_options
WHERE autoload IN ('yes', 'on');
Performance Impact
What Changes
- Better — Most requests load and parse less data at bootstrap time
- Better — Reduced memory consumption during request processing
- Slightly slower (individual requests) — Requests that access non-autoloaded options trigger an additional database query for that specific option
What Doesn't Change
- Site functionality — options are still accessible
- Database structure — nothing is deleted
- Plugin compatibility — plugins work normally
Typical Results
Results vary based on how bloated your options table was to begin with. Sites with years of plugin history and deactivated plugins tend to see the largest gains.
Realistic Savings by Site Type
| Site Type | Expected Reduction | Daily Impact (1,000 req/day) |
|---|---|---|
| Typical (8-12 plugins) | 100–300KB per request | 100–300MB database load |
| WooCommerce (15-20 plugins) | 500KB–2MB per request | 500MB–2GB database load |
| Heavily bloated (30+ plugins) | 2–5MB+ per request | 2–5GB+ database load |
FAQ
- Will this break my site?
- No. The Autoloader Optimizer only changes the autoload flag, never deletes any data. When a plugin or WordPress core requests an option that's no longer autoloaded, WordPress will still load it from the database — it just won't be loaded on every single request. Additionally, a full backup is created before optimization, and you can restore it with one click if anything unexpected happens.
- Why aren't unrecognized options optimized automatically?
-
Because we can't verify their source. They might be options from your active theme (which uses
non-standard prefixes), options from a must-use plugin in
/wp-content/mu-plugins/, custom options from your own code, or options from a plugin with non-standard naming. Automatically optimizing unrecognized options would risk breaking functionality we don't fully understand. We display them for your review instead. - What about plugins with non-standard prefixes?
- Since v1.1.18, we use the TextDomain from the plugin header to generate additional prefixes, which captures most non-standard naming. However, some plugins use prefixes that bear no relation to their name (e.g., custom abbreviations in legacy code). For these cases, you can use the Developer Filter Hook to protect the options, or manually inspect the option and make your own decision.
- Why does the plugin still create options for features I'm not using?
- Most WordPress plugins create all their option keys during installation, regardless of which features you enable. This is simpler than dynamically checking for feature activation. The Autoloader Optimizer helps mitigate this by not autoloading options from deactivated plugins or features you're not currently using.
- How much can I realistically save?
- It depends on your site's plugin ecosystem. A typical site with 8–12 plugins can expect a 100–300KB reduction per request. A WooCommerce site with 15–20 plugins can see 500KB–2MB. A heavily bloated site with 30+ plugins and years of history can see 2–5MB+ per request.
- What happens if a plugin is reactivated after I've disabled autoload for its options?
- The options will still function normally. WordPress will load them on-demand when the plugin requests them. If you want those options autoloaded again, you can use the Restore Backup function to revert all changes, or manually re-enable autoload for specific options in the database.
- Does this affect transients or cron events?
-
Transients and cron schedules stored in
wp_optionsare candidates for optimization, but they're typically accessed only when needed. The module flags large ones for your review. You can protect them using the Developer Filter Hook if you prefer they remain untouched.
Start Optimizing Your Autoloaded Options
WP Multitool's Autoloader Optimizer monitors your wp_options table, identifies
bloated and orphaned autoloaded data, and shows you exactly what's safe to clean up —
with full backup and one-click restore.