Back to articles
The wp_options Autoload Trap: Why Your WordPress Site Gets Slower Over Time

The wp_options Autoload Trap: Why Your WordPress Site Gets Slower Over Time

via Dev.to WebdevWP Multitool

The Query That Runs on Every WordPress Page Load Before WordPress does anything useful — before it loads your theme, runs your plugins, or renders a single pixel — it runs this query: SELECT option_name , option_value FROM wp_options WHERE autoload = 'yes' This loads every autoloaded option into memory. It happens on every page load, every admin page, every AJAX request, every REST API call. There is no way to skip it. On a fresh WordPress install, this returns maybe 200 rows totaling 100KB. That's fine. On a 2-year-old site with 30+ plugins installed (and 15 later deleted), it returns 2,000+ rows totaling 3-8MB. That's a problem. How It Gets Out of Control When a plugin is installed, it typically creates options in wp_options with autoload = 'yes' . This is WordPress's way of saying "load this into memory early because it's needed on every request." The problem: Plugins are generous with autoload. Many plugins flag every option as autoload, even settings that are only used on one admi

Continue reading on Dev.to Webdev

Opens in a new tab

Read Full Article
6 views

Related Articles