You open the Site Health panel in your WordPress and there it is, a critical warning that chills your blood: "Automatically loaded options could affect performance.". If you have arrived here, this message is probably familiar to you. You may have seen it after installing a performance plugin or simply during a routine checkup. The good news is that you are not alone and, most importantly, this problem is solvable. This step-by-step guide will take you through the diagnosis, the root cause and the ultimate solution to optimize your database and restore your site's speed.
What are "automatically loaded options" and why do they affect performance?
To understand the problem, we must first travel to the heart of your WordPress installation: the database. Within it, there is a fundamental table called wp_options. This table is the brain of your site, storing all kinds of settings: the URL of your website, the title, the configuration of the active plugins, the theme options and much more.
Each row in this table is an "option". And each option has a special column called autoload. When this column is set to 'yes'says to WordPress: "Hey, I'm very important! Load me into the memory in each of the page loads of this site".
In theory, this is efficient. It allows WordPress to have instant access to critical data without having to query the database repeatedly. The problem arises when the amount of data with autoload='yes' becomes excessive. Imagine that on each visit to any page of your website, WordPress had to load the equivalent of an entire novel in memory. The result is inevitable: a slower site, higher server resource consumption and a worse user experience.
Initial Diagnosis: The tool for WordPress Site Health is your first ally. Not only does it alert you to the problem, but it often quantifies the impact, showing the "total size of the autoloaded options". According to discussions in the WordPress.org forumsIf the size of the file is above 800 KB - 1 MB, this is already considered a threshold where performance may start to suffer.
Step 1: Identify the Culprits of the Excess of Self-Loading Data
The solution is not to disable random options. Doing so could break critical functionality of your site. The goal is to perform an investigation to identify which plugins, themes or residual data are causing the overweight. Sometimes generic optimizers are not enough, requiring a more surgical approach.
Analysis Method: Using a SQL Query
The most accurate way to find the heaviest options is to query the database directly. If you are not comfortable with this, you can use plugins like "Advanced Database Cleaner" that offer a more user-friendly interface. However, learning how to do it manually gives you full control.
Critical Warning! Before making any changes to your database, it is absolutely essential that you make a complete backup of your site (files and database). An error here could render your website inoperable.
Follow these steps for manual research:
- Access the management of your database, usually through phpMyAdmin in your hosting control panel.
- Select the database of your WordPress site in the left column.
- Click on the "SQL" tab.
- Paste the following query into the text box and run it. This query will show you the 20 largest autofilled options, sorted by size.
SELECT option_name, LENGTH(option_value) AS option_value_size
FROM wp_options
WHERE autoload = 'yes
ORDER BY option_value_size DESC
LIMIT 20;
Interpreting the Results: Who is Who?
When you run the query, you will get a table with two columns: option_name and option_value_size (the size in bytes). The key is in the option_name. Option names often have prefixes that give away their origin:
wc_owoocommerce_: They belong to WooCommerce.elementor_: From the Elementor visual layout tool.wpseo_: From the Yoast SEO plugin._transient_: They are temporary options (cache). They can often be the cause of the problem if they are not purged correctly.- Strange names with no clear prefix: They can be from plugins or themes that you no longer use.
Beware of "Orphan Data": An extremely common problem is options left behind by plugins that you uninstalled some time ago. A user in the WordPress support forums discovered that he had many options for litespeed autoloaded, even though you no longer use this caching system. This "orphaned data" is dead weight that slows down your site without contributing anything.
Step 2: The Solution Strategy for the Error "Automatically loaded options may affect performance".
Once you have identified the heaviest options, it is time to act. The strategy will depend on the type of option you have found.
Case 1: Active Plugin Options
If the option belongs to a plugin you actively use, do not delete it or change its status from autoload lightly. First, do your research:
- Check the plugin configuration: Is there an option to disable a logging, history or cache function that may be generating that massive entry? For example, some security plugins keep extensive logs in the options table.
- Contact plugin support: Open a support ticket and explain the situation to them, showing the name of the option and its size. They know your code best and can give you the safest solution.
Case 2: Transients Options (Temporary Cache)
Transients (whose names usually begin with _transient_ o _site_transient_) are designed to cache data for a limited time. Sometimes, they can grow out of control or fail to expire properly. Options such as _transient_dirsize_cache are common examples.
- You can safely remove them: Removing transients is usually not dangerous. WordPress and plugins will regenerate them when they need them. You can use a plugin like "Transient Manager" or run a SQL query to remove them.
- SQL query to clear transients:
DELETE FROM `wp_options` WHERE `option_name` LIKE ('%_transient_%')
Case 3: Orphaned Options of Uninstalled Plugins
This is the ideal scenario for cleanup. If you are 100% sure that an option belongs to a plugin that no longer exists on your site, you can take action.
The safest and most recommended solution is to change the value of autoload from 'yes' a 'no'. This way, the data is still in the database just in case, but it will no longer be loaded on every page, solving the performance problem.
How to change 'autoload' to 'no'? This should be done with extreme caution. Changing this for an essential option may break your site. Only do this with orphaned options or if the plugin developer instructs you to do so.
- At phpMyAdmingo to the table
wp_options. - Use the search function to find the
option_namespecific. - Click on "Edit" in that row.
- Search the field
autoloadand changes its value fromyesano. - Save the changes.
Step 3: Best Practices to Prevent the Problem from Occurring Again
Fixing the problem is great, but preventing it is even better. Adopt these habits to maintain your board wp_options clean and optimized.
- Be selective with plugins: Do not install plugins lightly. Always choose well coded plugins, with good support and frequent updates. A poorly programmed plugin is one of the main causes of a
wp_optionsswollen. - Uninstall plugins correctly: When you stop using a plugin, don't just deactivate it. Uninstall it. Many quality plugins have an option to "remove all data on uninstall". Use it.
- Conducts periodic audits: Once every few months, run the SQL query shown to check the status of your autoloaded options. A quick check can prevent a major problem.
- Use a database cleanup plugin: Tools such as WP-Optimize or Advanced Database Cleaner can help you automate the cleaning of expired transients, revision entries and other unnecessary data.
Conclusion: From a Warning to an Optimization Opportunity
See the warning "Automatically loaded options could affect performance (WordPress site health)" may be alarming, but it's actually an excellent opportunity. It's a signal from WordPress to look under the hood and perform essential maintenance that will drastically improve the speed and efficiency of your website.
By following the steps in this guide - accurately diagnose, identify the culprits, apply the correct solution with caution and adopt best practices - you will not only resolve the issue, but ensure optimal performance in the long run. Your server will thank you, and your visitors, with faster load times, will thank you, too.
