Welcome to the second and final part of our 2-part Autoload Data series! In part 1, we covered just what autoload data is, how it can drastically slow down your WordPress website, and how to investigate just how much of it exists on your own website.
Here in part 2, we’ll now navigate you through the process of removing any unwanted autoload data, to get your website back into shape. As always, please be sure to take a backup before making any changes to your website files or database.
How To Remove Unwanted Autoload
Option 1: phpMyAdmin
When determining whether certain autoload table options are needed or not, many of them will be immediately obvious to you, such as those referencing old plugins you no longer use. For the remaining autoload tables you’re less sure about, you’ll need to do a bit of investigation as to what they are. One of the best ways you can do that is to head to Google and search for the option_name, which will usually lead you to what plugin is responsible for that option.
Alternatively, click ‘Edit’ on the left, and see if the option_value gives you any clues as to what the option is doing. Here’s an example below:
As you can see in the above screenshot, the largest autoloaded option is “vaultpress_service_ips_external”, which fortunately for us is quite self-explanatory. Vaultpress is a popular backup and security plugin which is no longer in use on this particular site. That being the case, there is no reason for ~200KB of its data to still be autoloading on every page! From here we have two options:
- Select ‘Edit’ on the left, and then change the autoload value to ‘no’.
- If you’re 100% certain that the option is no longer in use at all, you can simply select ‘Delete’ and permanently remove that option from your database.
Whichever method you choose, make sure you do your research and always take a backup first. If you’re still not sure, you can set autoload to ‘no’, and check if it impacts any pages on your site. If it does, you can set it back to ‘yes’. You can even turn off autoload for a few weeks, and if there’s no noticeable impact, then it’s probably safe to delete the option.
It’s also important to note that turning off autoload for an option will not prevent it completely from loading. It will simply not load automatically on every page, but it will still load if a page requests it.
Option 2: WP-CLI
In our last post we showed you how to find your largest autoloaded data using WP-CLI. Here, we’re going to move on to inspecting an option and then removing or altering it to not autoload.
It’s strongly recommended that you take a database backup prior to making any changes. If you’re using WP-CLI, you can use the ‘db export’ command to quickly generate a database backup:
wp db export database.sql
If you’re not quite sure whether an option is necessary or not, you can further inspect the contents of that option to gather further information with WP-CLI. To do that, you can use the “wp option get” command:
wp option get “your-option-name”
This will list the contents of that option, and hopefully help you to identify if it’s necessary to be automatically loaded on every page of your website or not.
Once you’ve inspected the option and you’re 100% confident that it doesn’t need to be autoloaded, run the following command to disable autoload:
wp db query “UPDATE $(wp db prefix)options SET autoload=’no’ WHERE option_name=’your_option_name_here'”
Ensure that you replace ‘your_option_name_here’ with the option name that you would like to disable autoloading on.
If you would prefer to delete the option altogether, you can use this command:
wp option delete “your_option_name”
Once the option has been deleted or disabled from autoloading, you can re-run the check to assess your autoload option size to confirm that it has been reduced:
wp db query “SELECT SUM(LENGTH(option_value)) as autoload_size FROM $(wp db prefix)options WHERE autoload=’yes’;”
Your total autoload size should now show that it has been reduced by the total size of the option that was disabled.
That’s a wrap for our Autoload Data series! We hope you’ve learned some new tools to help you optimise your WordPress website and get the absolute most out of your site’s performance.
As always, if you have any questions about this post or our shared hosting, VPS, reseller or dedicated server plans, simply call us on 1300 MY HOST (694 678) during business hours, or submit a ticket through our Support Portal and one of the crew will be in touch!