Mastering the wp_options Table: How to Manually Clean Up Autoloaded Data for a Faster WordPress Site

XeroWP Jul 9, 2026 6 min read
Mastering the wp_options Table: How to Manually Clean Up Autoloaded Data for a Faster WordPress Site

The Silent Performance Killer in Your WordPress Database

When WordPress users talk about site speed, they usually focus on image compression, CDN integration, or choosing the fastest caching plugin. While these are critical components of a fast site, they often overlook the engine room: the WordPress database. Specifically, the wp_options table.

Over time, as you install and uninstall plugins, test new themes, and change site settings, your wp_options table accumulates junk. The most dangerous type of junk is autoloaded data. If this table grows too large, your Time to First Byte (TTFB) will suffer, and your server will work significantly harder than it needs to. In this guide, we will dive deep into how to identify and clean up these options manually using SQL, giving you a leaner, faster site without the overhead of another 'optimization' plugin.

What Are Autoloaded Options?

Every time a page on your WordPress site is requested, the system performs a specific SQL query to fetch settings. This query looks for all rows in the wp_options table where the autoload column is set to 'yes' (or 'on' in newer WordPress versions).

These options are loaded into memory on every single page load, regardless of whether that specific page actually needs them. The logic behind this is to reduce the number of individual database queries. If WordPress knows it needs the site URL, active plugins, and theme settings for every page, it makes sense to grab them all at once.

However, the problem arises when plugins—even those you have long since deleted—leave behind large chunks of data in this table and keep the autoload flag set to yes. When your autoloaded data exceeds 1MB, your site's performance begins to degrade. On high-traffic sites, a 5MB or 10MB autoloaded data set can cause massive memory spikes and slow down the entire server.

Step 1: Measuring the Current Bloat

Before we start deleting things, we need to know the scale of the problem. You can run these queries through tools like phpMyAdmin, Sequel Ace, or the command line if you have SSH access to your XeroWP server.

To find the total size of your autoloaded data (in bytes), run this query:

SELECT SUM(LENGTH(option_value)) AS autoload_size 
FROM wp_options 
WHERE autoload = 'yes';

Divide the result by 1,048,576 to get the size in Megabytes (MB). If the result is under 800KB, your database is in great shape. If it is over 2MB, you have work to do. If it is over 10MB, you have likely found the primary cause of your site's sluggishness.

Step 2: Identifying the Top Offenders

Now that we know the size, we need to find the specific rows causing the bloat. We want to list the largest autoloaded options in descending order:

SELECT option_name, length(option_value) AS option_value_length 
FROM wp_options 
WHERE autoload = 'yes' 
ORDER BY option_value_length DESC 
LIMIT 20;

This query will return the top 20 largest options. Look closely at the option_name column. You will likely see names that correspond to plugins you no longer use. For example:

  • _transient_: Many transients (temporary cached data) are set to autoload. If they aren't being cleared properly, they can balloon.
  • elementor_: Data left over from page builder sessions.
  • jetpack_: Extensive configuration data that might not be needed on every page.
  • rewrite_rules: This is usually a core WordPress option, but if it's massive, it indicates a plugin is constantly flushing your permalinks.

Step 3: Cleaning Up the Data Safely

Warning: Always perform a full database backup before running DELETE or UPDATE queries. One wrong move can break your site's configuration.

Strategy A: Switching Autoload to 'No'

If you aren't sure if a plugin still needs a piece of data, but you know it shouldn't be loaded on every page, the safest route is to change the autoload status to 'no'. This keeps the data in the database but prevents it from being loaded automatically on every request.

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

Strategy B: Deleting Obsolete Data

If you find options from a plugin you deleted years ago (e.g., an old slider plugin or a retired SEO tool), you can safely delete the rows entirely:

DELETE FROM wp_options 
WHERE option_name = 'old_plugin_setting';

Real-World Example: The Transient Trap

Transients are meant to be temporary, but if a plugin developer doesn't set an expiration or if the cleanup cron job fails, your wp_options table can fill up with thousands of rows of _transient_ data.

You can check how many autoloaded transients you have with this query:

SELECT COUNT(*) 
FROM wp_options 
WHERE option_name LIKE '%_transient_%' 
AND autoload = 'yes';

If you have thousands, you can safely clear them. WordPress will regenerate them as needed. To clear all transients:

DELETE FROM wp_options 
WHERE option_name LIKE '%_transient_%';

Advanced Tip: WordPress 6.6 and 'On'/'Off'

With the release of WordPress 6.6, the core team introduced significant changes to how autoloading works. Instead of just 'yes' and 'no', WordPress now uses 'on', 'off', and null. It also introduced a mechanism to dynamically disable autoloading for options that are too large (over 128KB).

However, this automatic protection only applies to new options or options being updated. It won't retroactively fix the 5MB of junk left by a plugin you uninstalled in 2021. Manual intervention is still the gold standard for database health.

Maintaining a Lean Database

Cleaning your database shouldn't be a one-time event. To keep your site running at peak performance on XeroWP, follow these best practices:

  1. Audit your plugins: Before installing a new plugin, ask if you truly need it. Every plugin is a potential source of database bloat.
  2. Use 'Clean Uninstall' features: Some plugins (like Advanced Custom Fields or certain SEO suites) have a 'Delete all data on uninstall' toggle in their settings. Use it.
  3. Monitor your site's health: Use the Site Health tool in the WordPress dashboard (Tools > Site Health), which now warns you if your autoloaded data is getting too large.
  4. Leverage Managed Hosting: At XeroWP, we optimize the server environment to handle database queries efficiently, but a clean application-level database is the foundation of a truly fast site.

Conclusion

Optimizing your wp_options table is one of the most effective ways to reduce server response time. By identifying the largest autoloaded options and removing the baggage left by old plugins, you ensure that every byte loaded into memory is actually necessary for your site to function.

Ready to host your WordPress site on a platform that values performance as much as you do? Check out XeroWP for managed hosting that takes the hassle out of scaling.