The schedule.wp_optionsCore settings retain templates and plugins; some of the data is also read with autoload when bootstrapping WordPress. The problem is not just the number of rows or file size. A few large, auto-loaded options can increase the memory and timing of each request, while thousands of small, non-autoload options may have little immediate effect.
Quick answer:Measure the total size of the autoload, the largest options, the name pattern, and the owner. First, modify the plugin or job builder, and then use backup and clone, from the official data owner API or method to delete. Removing the anonymous option or changing the autoload group on the production can disable the site.
What data is entered into wp_options?
- Site settings and plugins
- Template data and widgets
- transient and temporary cache
- Cron and rewrite information
- Token, migration status or feature flag
- The remaining records from the plugin have been deleted.
The option name is a reference, not a proof of ownership. Before deleting it, you should check the code or documentation of the author.
What exactly is the effect of Autoload?
WordPress loads autoload options to reduce individual queries at the beginning of the application. This behavior is useful for small, repetitive settings. When the payload becomes very large, the cost of transferring the database, deserialize, and PHP memory repeats on multiple requests.
How do we check the size?
First, find the actual prefix of the table.option_valueIt may contain secret or personal data; do not print the full amount in the public report:
SELECT autoload,
COUNT(*) AS option_count,
ROUND(SUM(OCTET_LENGTH(option_value)) / 1024 / 1024, 2) AS value_mb
FROM wp_options
GROUP BY autoload
ORDER BY value_mb DESC;
SELECT option_name,
autoload,
OCTET_LENGTH(option_value) AS value_bytes
FROM wp_options
ORDER BY value_bytes DESC
LIMIT 30;
Autoload values in different versions of WordPress may just beyes/noNo, interpret the result by the behavior of the installed version and do not copy the deletion condition from the online sample.
Practical causes of growth of the table
- A plugin that stores a large cache or response as an option.
- Temporary transients or no effective cleanup.
- Record a new option named Dynamic at each run.
- Impaired migration and keeping old versions of settings.
- A deleted plugin that hasn't been uninstalled.
- A row, log, or session that is mistakenly stored in options.
- The growth of a serialized single array instead of maintainable records.
How do we find the owner of the option?
Put together the name prefix, installation/update time, option name search in the code, and uninstall documents. With WP-CLI, metadata can be read, but value display may be sensitive:
wp option get OPTION_NAME --format=json
OPTION_NAMEReplace it with a valid name. This command gives a lot of output to a large structure; don't store it in a public ticket or a shared shell.
Do not blindly delete Transient.
The transient is by nature temporary data, but collective deletion can cause a cache stampede, external API load, or high CPU. First check expiration, number, and owner. If the expired transient is re-accumulated, fix the cleanup, cron, or plugin problem; periodic deletion only hides the mark.
The phased correction plan
- Restore backup and clone.
- Record the volume of the autoload and the 30 big options without revealing the value.
- Verify the request's profile and its connection to options.
- Identify the owner and needs of each candidate.
- Update or modify the official plugin and cleanup.
- First, implement the change on the clone.
- Measure PHP, TTFB, Query count and site behavior before and after.
- Apply limited and rollback changes to production.
Should we turn off the auto load?
If the option is required on almost every request, disabling the autoload can add a separate query. If it is read only in the admin or specific job, the change may be reasonable; but the official API and the plug-in compatibility must be followed.
Serialized data and Search/Replace
Many options have a serialized or JSON structure. Direct text editing can break down serialization lengths or change encoding. For domain, path, and data structure, use serialization-aware tools such as WP-CLI and the official migration command; preview and backup are also required.
It's a sign that the cause is somewhere else.
If the query slow log refers to another table, the database network latency is high, or the wp-admin slows down only when contacted by an external API, shrinking options probably won't solve the main problem.Find Slow Queries with evidenceAnd for the bigger picture.The WordPress database optimization guideLook at that.
Common Mistakes
- The execution
DELETEWith a vague name pattern. - Remove option activate form or payment gateway
- Share the option value includes a token or API key
- Change all the autoloads to a certain amount.
- Ignoring the real prefix and multisite
- Clear the cache without the manufacturer fixing the data.
The measure of success.
Reduced payload autoload should be associated with a decrease in memory consumption or bootstrap time and no Query regression. Smoke test login, frontend, save settings, cron, checkout and important callbacks. Follow the growth rate of option and cache miss over the next few days.
When do you need special assistance?
If the big option owner is not clear, the data is related to payment and checkout, or the change in autoload results in a contradictory result, direct deletion is not appropriate.WordPress speed boost serviceIt can check the request profile, object cache and options structure together before changing production.
Common Questions
What is the appropriate volume of the auto load?
There's no universal number; the version, the number of workers, the object cache, and latency are important.
Does Redis solve the wp_options problem?
It may cache the query, but the large payload, memory and invalidation remain.
Does deleting the plugin delete your options?
The uninstall behavior of each plugin is different, and some tools intentionally keep the settings for reinstallation.