My favorite commands for cleaning up autoloaded data from your wp_options table.
Why should you remove autoloaded data? It’s because this type of data is loaded on every page load and often contains data that is no longer used (left behind by already deleted themes/plugins) or left behind because WP-cron wasn’t working and some plugins didn’t clean up after themselves.
Get into your phpmyadmin tool from webhosting control panel (cPanel, Plesk, etc) and follow the commands below!
How much difference can autoloads make?
HUGE! Freaken huge! I’ve seen awful bloated sites with many MB of autoloaded data. Cleared it all and the whole site felt so much lighter, both on frontend and backend. Keep in mind y’all, the backend can’t be cached. Cleaning autoloads definitely has a measureable impact on massively bloated sites and one of the advanced tasks that separates pros from non-pros.
NOTES:
- Backup your database before trying any of these optimizations.
- If your database has a prefix (e.g. “wp_123abc_” instead of only “wp_”), then retype SQL commands below using the prefix “wp_123abc_options” instead of “wp_option”.
1. Check autoloaded data size
SELECT SUM(LENGTH(option_value)) as autoload_size FROM wp_options WHERE autoload='yes';
This one shows you how big the autoloaded table is. Anything above 1MB really badly needs to be cleaned up; I’ve seen sites with even 40MB (no wonder they crashed!). I try to stay below 500kb if possible (although even 1MB is considered OK). If you have 500kb or less, you can stop here!
2. List top autoloaded data entries
SELECT option_name, length(option_value) AS option_value_length FROM wp_options WHERE autoload='yes' ORDER BY option_value_length DESC LIMIT 200;
This will list the top 30 autoloaded data entries in the table. Delete the ones you know aren’t being used anymore. You can also increase the DESC LIMIT 200 to a higher number like 300 or 500 if you want to see more items. Usually the first 10-50 items make up the bulk of your autoloaded data anyway. And it’s usually only a few plugins that are creating most of the bloat. (Although some really old sites may have tons of stuff left over from deleted themes and plugins.)
3. Find specific autoloaded data
SELECT *
FROM `wp_options`
WHERE `autoload` = 'yes'
AND `option_name` LIKE '%jetpack%'
This command is useful for targeting specific plugins that you KNOW for certain you aren’t using any longer. This is great for cleaning up remnants left from old themes and plugins. Simply replace the string “jetpack” with anything else you like. You’ll also notice that many plugins don’t use their full name. For example, items related to “Full Velocity Minify” plugin might be listed with the string “fvm” in the database.
4. Tracking down mystery autoloads
Did you see some giant autoloads but you’re not sure whether or not you can delete it? Don’t you worry, I have a few handy tricks up my sleeve:
- Click on edit and look at the data inside. Sometimes they give you a clue what it’s used for.
- Search the option name in Google in quotations. It might also help if you type the word “WordPress” or “plugin” or “theme” before it.
- You can also try using step #3 above, but search only the first prefix of the option name. For example, if the full name is “wds_service_results” then you can do step #3 but replace “jetpack” with “wds_”. Sometimes, you’ll find the other option names with more helpful data to track down which plugin it is.
- Last but not least, you can simply change the autoload value to “no”. (Then change it back if anything breaks, or delete after a month if all is well.)
Johnny’s personal autoload removal list
A list of the biggest autoload offenders that I often run into. If you see any autoloads you aren’t familiar with. Google around to see what they might be related to. Perhaps an old theme or plugin you haven’t used in a while. (Obviously, you should not delete any autoloads for active plugins!)
Plugins with high autoloads
- BackupBuddy
- BeRocket
- cherry_customiser_fonts_google – probably came from some Google fonts plugin
- Image Map Pro for WordPress
- Jetpack
- Mobi by Phpbits
- Pegasus Accelerator WP
- Redirect plugins
- Redux framework (any theme using this)
- Revolution Slider (of course!)
- SchemaPro
- Security Ninja
- Spectra Gutenberg Blocks
- Thrive Architect/Leads
- transients – some people don’t realize they have 40mb of transients sitting there! (YIKES!)
- WPMU DEV (and their many plugins)
There’s hundreds more plugins with awful autoload…find them all! (Feel free to report in the comments and I’ll add them here.)
Themes with high autoloads
- Martify
Adam Polinsky
Will removing autoloaded data improve speed on the frontend after caching? My autoload is currently 0.67MB. If I bring it down below 500kb will I see a big speed boost?
Thanks!
Johnny
That won’t be much of a difference on front-end. But might make your backend feel 5% faster.
Sascha
Just came here via your latest article about Astra 😉
On one of my bigger sites I had an autoloaded table of 1.5 MB, so I went for Step 2.
The biggest entry (made almost 80% of the 1.5) is named “ct_svg_sets” and contains lots of stuff related to font awesome.
Have you heard if this before? Or do you know about which plugin may have added or is still adding up to grow this field?
Cheers 🙂
Sascha
Johnny
Sascha, have you tried my tactics above for figuring out which plugin that is?
Sascha
Jup, but no result came up. I will run a DB-backup, delete this entry and test the site thoroughly afterwards … Let you know if I find out any related plugin, so can add it to your list if you like 🙂
Blue
How does it go? I have the same situation in my database as well? 😳
Johnny
I just searched and saw “ct_svg_sets” is related to Oxygen Builder. https://www.gitmemory.com/issue/soflyy/oxygen-bugs-and-features/770/687011191
Pratyaksh Somani
One of my website has autoload size of 2.67MB.
I Started investigation.
Add these plugins also:
1) Digits
2) RankMath
3) Yoast (wpseo) (I uninstalled this plugin prior to install Rankmath but the table was still there)
4) Image Optimizer, Resizer and CDN – Sirv (adds lots of tables and autoload data left after plugin removal)
5) Facebook for Woocommerce (wc_facebook)
6) Oxy toolbox (oxy_toolbox)
7) WP Notif
Also, Fast velocity has tables with name ‘fastvelocity’ also
Johnny
Hehehe, now you are learning and finding them all!!! There are so many of them!
Pratyaksh
Yes Johnny, in my free time I read your blog and FB group comments to optimize website and server performance to learn something new…
Igor
Hi Pratyaksh, we’ve minimized Sirv’s impact on the autoload size in the latest update.
Mateusz
Awesome stuff! Thanks! Just cleare wc_facebook autoloads >800kb
Figthing with ct_svg_sets as well now! 😉
Johnny
Happy for you. 800kb is a lot!
Christoph
Hi johnny. Thrue reading alot about autoloads i also found the advanced db cleaner pro. It seems it dies the same job but maybe for some nit technicer safer. U have experience with the plugin?
Johnny
Yes, I’ve used and really liked Advanced DB Cleaner. If it works well and easy to understand for you, use it.
Laura
Great article, Johnny!!
I noticted a big table in my database: _transient_dirsize_cache
Usually transients are safe to remove, but the “cache” in the name makes me a bit confused…
Do you know if it is safe to delete?
Johnny
The answer for this one is to search it on Google and see if it’s related to a critical plugin you’re using. If not, then try my suggested step of setting its autoload setting to “NO” for a week before deleting.
Sam
Hi Did you ever work this out? I have searched google and cannot find anything conclusive. I did come to the conclusion it was used by Woocommerce but I don’t know. Mine is also very large for autoload.
karim
me too have this autoload option (_transient_dirsize_cache) with a big size about 1MB
i searched all the internet i do not know which plugin use it
please if you have a good solution till me
thanks
Nate
Looks like a trac ticket has been created for this in WP Core. https://core.trac.wordpress.org/ticket/54221
Kingsley Felix
So how do you remove them when you find them?
Tristan
You can deactivate them with a neat little plugin called Supervisor. When you deactivate an autoload option, you are not removing it. You are just telling WordPress to not load that option automatically on every request it does. In other words, the option will be loaded only when it is needed.
Johnny
Cool idea. I’ll check it out myself.
Michael Baierl - Einfach Websites
Hi Johnny,
I doubt this makes any huge difference… the database is made for storing data and loading a few megabytes might slow down the website a little bit. But it’s just a little bit, compared to loading all the assets and everything else on the page.
So I think this “fix” is in the same league as cleaning up unused .htaccess-entries. Hard to measure, if at all.
Did you measure it?
Michael
Johnny
Your comment just makes me want to scream.
But I’ll try a brief explanation instead.
– Autoloads can make a massive difference that’s not only measure-able but FELT.
– Database weight is not all equal. Most DB items are not loaded in memory. Autoloads however are prioritized and therefore always loaded in memory…making them much heavier and more impactful than other “regular” database data.
– This fix is definitely not in the same league as cleaning unused .htaccess entries. I hope whoever said that is not an expert you’re paying money for.
– Measuring autoloads is not the same way you measure (I assume) waterfall items on a simple speed test. Static data sent over network transfer weight does not impact server load the same way with data loaded in memory.
Anyway. What I say today probably won’t make any sense to you. But when the time comes…you’ll appreciate knowing how to clean autoloads. This task is one of what separates the pros from the non-pros.
Last but not least…I don’t waste my time free guides with no immeasurable impact. Nobody has time to write (or read) junk like that.
Amar
Hey Johnny,
Thanks for this awesome guide!
I found a way to search where these tables belong. WP Hive tracks all changes caused by a plugin. I simply used the table name search on Google Custom search for WPHive.com. You can integrate it in your article if you found it useful: https://www.google.com/search?q=site%3Ahttps%3A%2F%2Fwphive.com
David
Holy smokes……24MB of autoloaded data which on top position are:
cplus_ultimate_google_fonts > 4.6MB
ultimate_google_fonts > also 4.6 MB
these are font packages with a lot of fonts in them.
But…..never had downloaded such packages and want to know if I can delete these.
Johnny
Figure out what plugin they’re coming from and decide for yourself.
David
Thanks Johnny. Your articles have opened my eyes. Followed up on most of your “unorthodox” suggestions and got rid of all the bloat on my site.
Niko
A good tool to use to know to what plugin might below a wp_options row :
https://plugintests.com/
there is a section on what the tested plugin adds to the db table. Not exhaustive, but pretty good.
Anthony
Your blog is awesome! So much solid info for free! My wp_options table was only like 650kb but I went through anyway and removed what I knew wasn’t in use anymore. Things like monsterinsights, jetpack, and theme_mods (from twenty-whatever themes and Pinnacle theme which I had tried a while back) were my biggest offenders. Only shaved off about 75kb of autoloads BUT also shaved off a whole second of load time from the front-end of my site! Thanks a ton!
Leslie Hall
Thankyou for writing this article. I am a new user of WP and was having a hard time figuring out how to clean my sites options table. I thought I was going to have to hire someone to help me until I found this article with easy-to-follow instructions.
dingonobru
Hi Johnny.
Thanks for your tutos, very helpfull.
I’ve got only 359818 bits of autoload options (692).
only 550 of them are used.
i tried to remove the autoload setting for some empty options but it comes back every time
I tried the Supervisor plugin but it show only the 10 first options who are needed anyway.
And sometimes no informations on the option about the plugin owner (no prefix).
For exemple i’ve got SKROLLEX theme and it create an option widget for each plugin i had or got and they are all autoloaded.
I’m using Database Cleaner from Jordy Meow and his plugin allow me to assign an option to a plugin, if i find out….
And when i remove plugins i can see what option i can delete if ,and only if, i assigned it before.
My question is a lot of options are empty but got the autoload setting.
How can i say WP only to load the used one or to load them only when needed, or not to load the empty ones, without a plugin ?