Skip to content

How to Remove Autoloaded Data

What is Autoloaded Data?

Autoloaded data is data that is loaded on every single page of your Wordpress website.  If that doesn’t perk your ears up – it should.  Autoloaded data is typically set to “yes” by default, meaning out of the box it’s setup to become an issue at some point down the line, particularly for larger, older sites.

Autoloading data is important for your theme options, site-wide plugins, etc.  So it does serve a useful purpose.  But you can imagine an older site experiencing years of plugin swapping and theme changes having quite a bit of old autoloaded data that’s still populating – even for removed plugins & themes!

Here are some scenarios when autoloading data is considered unnecessary:

  • Some developers actually store plugin data in the wp_options table (and set autoload to “yes”) in an effort to reduce the number of tables a plugin generates.  This can actually be a pleasant development choice in small doses.  The problem arises when every one of your plugins is autoloading their data on every page… you can imagine how slow things can get.  The wp_options table isn’t really meant to be utilized on a mass scale to autoload data.
  • Data is being autoloaded by a plugin when it doesn’t need to be in the first place. A great example is that of a popup plugin – do you need this to load on every page – or only the page with the popup?
  • Plugins and themes can leave behind old autoloaded data – even after removal… yikes.

Where do I find Autoloaded Data?

Quite simply this can be found in your SQL database in the wp_options table.  You can see below the “autoload” column on the far right.  See how everything is set to “yes”? This is OK – don’t panic and set everything to “no”.  Next we’ll show you how to run a simple SQL query that will show you exactly which of these rows is actually impacting your speed.

autoloaded data set to yes

SQL Query for Autoloaded Data

The snippet below will help you see which autoloaded data is sucking up the most juice.  

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

Click to Copy

*Note – if your tables start with something other than “wp_” you’ll need to modify “wp_options” to use your prefix instead.

In our screenshot below you can see the autoloaded length column – which is displayed in bytes.  We usually take a look at autoloaded data above the 100K bytes range – which is the equivalent of 0.1MB.  You’re probably noticing how many Jupiter_options_revisions rows are listed.  Jupiter is the theme for this particular case study – and you can infer that we really don’t need this many theme option backup/revisions stored.

Make a Backup Before Removing

We’ve now come to the conclusion that we really don’t need all of these revisions to our theme options, the latest one will do.  We’re going to copy our theme options as a backup before we do anything else.  Jupiter has a handy tool to export theme options (as do most premium themes).  If you start clearing out autoloaded data without knowing what you’re removing – you will lose settings!

Removing Autoloaded Data

The next part is simple, check which rows you want to drop – and delete!

Check your load times

The fun part! Test your load times before and after – see any improvements? It’s likely minor unless you had a really old, bloated install.  But hey, every little bit counts.

Comments