Skip to main content
WP HealthKit

Autoload

WordPress autoloading is a mechanism that loads all options marked as 'autoload' into memory on every page request, which can cause performance issues if overused.

How it works

When WordPress starts, it runs a single query to load all autoloaded options into the object cache. This is efficient for small, frequently-used values but becomes a performance problem when plugins store large serialized arrays or JSON blobs as autoloaded options. Each autoloaded option adds to the memory footprint of every single page load.

In WordPress

Use update_option('my_option', $value, false) to disable autoload for large or infrequently-used options. Check your autoloaded data size with: SELECT SUM(LENGTH(option_value)) FROM wp_options WHERE autoload = 'yes'.

Code example

// Bad: large data autoloaded on every page
update_option('my_plugin_cache', $large_array);

// Good: disable autoload for large/infrequent data
update_option('my_plugin_cache', $large_array, false);

WP HealthKit checks for Autoload-related vulnerabilities automatically

Run a Free Audit
WordPress Option Autoload — Performance Impact and Best Practices | WP HealthKit