I have a website that has suddenly become slow. I don't know what caused the change. I haven't installed new plugins, and I don't think I recently updated any plugins. Upon inspection with Query Monitor, I can see that there are about 15,000 queries per page. Most of the queries (14K+) are repeated queries to wp_options
SELECT option_name, option_value
FROM wp_options
WHERE autoload = 'yes'
Is the cause of these queries that certain rows that are supposed to have autoload='yes' do not? How can I figure out which rows should have autoload 'yes' vs 'no'
I tried copying the autoload 'yes' values from another website, and I was able to lower the total number of queries to 8.5K like this. However the website isn't any faster.
Any advice on debugging this issue or somehow "resetting" the autoload values of the wp_options table?
autoload
has nothing to do with this. There should not be 14k+ queries towp_options
for all options. The whole point of autoload is that there should only be one of these queries so that options are cached and future calls to get options do not go to the database. Something else has gone wrong. Try the usual debugging steps of disabling themes and plugins until the issue goes away. If you're using Query Monitor it should give you a trace of what's calling the query.