Optimising WP_Options

Optimising WP_Options


Over the past couple of weeks we’ve been completing some major website maintenance on a number of Wordpress websites that migrated over to our hosting a number of years ago. These weren’t sites that we built, but sites we acquired through recommendation when the original web hosts stopped trading.

The works included major upgrades from Wordpress core version 4.9 to version 5.7 and Woocommerce from version 3.4 to 5.2!

The benefit of all this was much more optimised code, security and the upgrade of PHP to the latest version. All works were completed on a staging site and we even drilled down to tuning and optimising the SQL databases.

Wordpress has one of the most messy, seat of the pants, shove stuff anywhere type of database structures EVER, particularly the older versions. It makes us cry every time we have to look in there crying.

What makes it even worse is when years and years of unnecessary data are stored, resulting in slow database calls as the server has to trawl through millions of data entries to do a simple task.

Anyways, enough Wordpress bashing, it’s getting “better” (Something I never thought I’d hear myself say). 

One starting area of Wordpress database tuning, often the most overlooked is the WP_Options table. It’s amazing how much heavy “autoload” junk gets dumped in here.

“Seriously, if you have a Wordpress website and it’s a couple of years old, you’ve been trigger happy with installing and uninstalling free plugins this area will be rammed!”

I deleted thousands of entries, in fact the start size of this table was 6.1mb with 4mb of autoloaded data from past “uninstalled” plugins, the size now is 366kb and my gosh has optimising that made a huge difference to improved site performance. 

There are plugins, both paid and free that say they will do this, but the correct way is to spend time doing it manually. You need to be careful though, deleting entries within a database can and will break your website if you’re not careful.

If you need help with upgrades, optimising and even hosting then please don’t hesitate to contact us.

Remember, Always take a backup of your database if you’re making amends or optimising your wp_options table.