The Business & Technology Network
Helping Business Interpret and Use Technology
«  
  »
S M T W T F S
 
1
 
2
 
3
 
4
 
5
 
6
 
7
 
8
 
9
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
29
 
30
 
 
 
 
 

How To Clean Your Options Table For Better WordPress Performance

Tags: media tech web
DATE POSTED:March 15, 2024

Did you know that there’s a really good chance that your WordPress database is still cluttered with the ghosts of plugins you no longer use?

Not only that, some of those options are automatically loaded up on every page view of your site. Clogging things up. Taking up more memory. All for no reason whatsoever.

This can adversely affect the performance of your WordPress site.

So, let’s talk about how to find out what is going on with your site and what you can do about it.

In This Post… What is the wp_options Table?

Your WordPress database has a bunch of tables in it. You can think of tables just like you would a sheet in an Excel spreadsheet. Your database has a bunch of tables in it.

One of those tables is called wp_options. This is one of the default tables that are part of WordPress.

The wp_options table is used to store settings. It could be settings from WordPress itself or from any of the plugins that have ever existed on your site.

There are 4 fields in this table and they are:

  • option_id – This is just an internal database ID. No big deal.
  • option_name – This is the name of the setting. It is using an internal name isn’t usually seen by end users, but the underlying code knows to look for it.
  • option_value – This is the actual value of the setting. In some cases it is simple, but in other cases this can be a massive amount of data.
  • autoload – If set to “yes”, this means the option is automatically queried and loaded up on every page of your WordPress site.

Over time, this options table can end up with a lot of entries. At the time of this writing, I checked my own options table for this very site and I have 3295 entries in my wp_options table.

But, merely having a lot of entries isn’t a problem. The problem is the ones set to be autoloaded.

The Problems With Autoloaded Options

As stated before, when an option is set to autoload, it will be loaded automatically on every page view.

Autoload defaults to “yes”. This is supposed to be convenient… and it is. However, not all options really need to be autoloaded. Sometimes, themes and plugins are just using wp_options as a storage place for stuff, but it isn’t information that needs to be loaded up all the time.

It is up to the plugin/theme developer to set the autoload to “no”. Since it defaults to “yes”, this means that clumsy developers may not actually take proper control over it for performance reasons.

For instance, what if a contact form plugin was storing settings in the options table and it was autoloaded? Those settings are only needed when the form is actually showing up on the screen. But, if all that stuff is set to autoload, it will load up everywhere.

But, the problem gets a little worse. And that’s because…

  • Data is being autoloaded when it doesn’t need to be.
  • Most plugins do NOT remove settings from the options table when they are deactivated and uninstalled. So, that leftover data sits there and continues to be autoloaded even though it is basically “ghost” data.
  • Many plugins/themes are overusing the wp_options table by storing all kinds of stuff in there rather than using their own custom tables. So, the table ends up getting overused.
Let Somebody Else Deal With The “Tech Stuff”

With WP Concierge, you no longer have to deal with the tech stuff. We’ll provide all the software, maintain it for you, and provide personal support along the way. All included… and you’ll be on a first name basis with your “web guy”

Learn More Book A Call How Much Autoloaded Data Is Too Much?

So, here’s the thing…

The MySQL database (the kind of database WordPress uses) is pretty fast. So, even if your autoloaded options is rather bloated, there’s a decent chance it might be hard to tell. Especially if your site is using object caching, this data is stored in the server memory and things can be rather snappy.

But, it does cause your site to have a bigger memory footprint. So, it is better to try to clean this stuff up somewhat.

If you can get a total size of your autoloaded data to be under 1MB, you’re in pretty good shape. If it gets bigger than that, you may want to take a little time to clean things up. And if you’re in a situation where you’re seeing autoloaded data getting up to 8-10MB or bigger, then your site is definitely bogged down and this is a situation you should handle.

How To Check How Big Your Autoloaded Data Is

A fairly easy way to do this is to run a query directly on your WordPress database. To do that, open up the database manager from inside your WordPress host. In most cases, that will be PHPMyAdmin.

Then, you’ll want to run the following SQL query:

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

Note that if your database is using a prefix on your table names, you may need to alter that. The default prefix is “wp_”, which makes the table name “wp_options”. If your’s is using a different prefix, change the query.

Now what you’re going to get back will be the total number of bytes. For instance, when I ran this query on my own site, I got the following result:

So that’s a total size of 1092584 bytes. There are 1024 bytes in a KB and 1024 KBs in a MB. So, basically, my total autoloaded data size is about 1.09MB.

I wouldn’t spend much time trying to clean up a 1.09MB data size unless I just felt like being a perfectionist.     </div>
  </div>
  <div class=

Tags: media tech web