What Are Autoloaded Options?
In WordPress, autoloaded options are configuration settings that automatically load with every page request. Stored in your database’s wp_options table (with the autoload field set to yes), these include:
- Core settings (site URL, timezone)
- Active plugin configurations
- Theme customization data
- Cached transients
While essential for functionality, unchecked accumulation can severely impact performance.
Why Clean Autoloaded Data?
- Reduce Database Bloat: Autoloaded data inflates your
wp_optionstable, slowing queries. - Improve Page Speed: Fewer database calls = faster page loads (measured by TTFB).
- Fix «Options Table Full» Errors: Prevents MySQL crashes on resource-limited hosting.
- Optimize Server Resources: Lowers CPU/memory usage during traffic spikes.
- Streamline Backups: Smaller databases = quicker backups and migrations.
Warning: Precautions First!
- Backup Your Database: Use UpdraftPlus or phpMyAdmin before making changes.
- Identify Critical Data: Never delete options starting with:
siteurl,home,active_plugins,template,stylesheet,rewrite_rules - Deactivate Plugins Temporarily: Some may recreate essential options if missing.
Step-by-Step Cleaning Methods
Method 1: Using Plugins (Beginner-Friendly)
Recommended Tools:
Steps with WP-Optimize:
- Install and activate the plugin.
- Go to
WP-Optimize → Database. - Check «Clean autoload options» under Clean options table.
- Click «Run Optimization».
- Monitor results in the «Autoload data size» metric.
Method 2: Manual Cleaning via phpMyAdmin (Advanced)
- Access phpMyAdmin via your hosting control panel.
- Select your WordPress database.
- Open the
wp_optionstable (prefix may vary). - Click SQL and run this query to identify candidates:
SELECT option_name, LENGTH(option_value) AS size
FROM wp_options
WHERE autoload = 'yes'
ORDER BY size DESC
LIMIT 20;
5 Carefully delete unnecessary entries using:
DELETE FROM wp_options
WHERE option_name = 'unneeded_option'
AND autoload = 'yes';
- Replace
unneeded_optionwith actual option names)
Method 3: WP-CLI Commands (Developers)
- Connect to your server via SSH.
- List largest autoloaded options:
wp option list --autoload=yes --order-by=size --format=json
3 Delete specific options (e.g., old plugin data):
wp option delete obsolete_plugin_option
4 Bulk clean transients:
wp transient delete --all
Identifying Safe-to-Remove Data
| Type | Examples | Risk Level |
|---|---|---|
| Plugin Residue | old_plugin_settings, jetpack_verification_code | Low |
| Expired Transients | _transient_timeout_*, _site_transient_* | Low |
| Unused Theme Mods | theme_mods_oldtheme | Medium |
| Orphaned Data | recently_edited, widget_deleted_pages | Medium |
| Core WordPress | cron, can_compress_scripts | High (Do not remove!) |
→ Verify unknown options via WordPress Option Reference before deletion.
Best Practices for Maintenance
- Audit Quarterly: Schedule cleanups every 3-6 months.
- Limit New Autoloads: Plugins like Disable Autoload prevent unnecessary additions.
- Monitor Size: Track
wp_optionsgrowth via Query Monitor plugin. - Transient Management: Use Transient Cleaner for automated cleanup.
- Avoid Over-Cleaning: Never delete >15% of autoloaded options at once.
Troubleshooting
Issue: «Site broken after cleanup»
- Solution: Restore database backup, then selectively re-add critical options.
Issue: «Options regenerating immediately»
- Solution: Deactivate culprit plugins before cleaning.
Issue: «Unknown options reappearing»
- Solution: Search plugin source code for
add_option( 'option_name', 'value', '', 'yes' ).
Conclusion
Autoloaded data accumulation is a silent performance killer in WordPress. Regular cleaning can reduce database load by 30-60%, significantly improving TTFB and user experience. For most users, WP-Optimize provides the safest approach, while developers benefit from WP-CLI precision. Always prioritize backups, and when in doubt, consult a specialist. Keep your wp_options lean—your server and visitors will thank you!