ZeroToWP

wp_options Table

Quick Definition

The wp_options table is the WordPress database table that stores all site settings, plugin configurations, theme options, transients, and other key-value data. It is the most queried table in WordPress.

Kinsta guide on cleaning up the wp_options table and autoloaded data

What Is the wp_options Table?

The wp_options table is a MySQL database table that stores virtually every setting in your WordPress site as key-value pairs. When WordPress loads, it reads this table to know your site's URL, timezone, default category, posts per page, active plugins, active theme, and hundreds of other settings.

Each row in wp_options has four columns:

  • option_id — Auto-incrementing unique ID
  • option_name — The setting's key (e.g., siteurl, blogname, active_plugins)
  • option_value — The setting's value (can be a string, number, or serialized array)
  • autoloadyes or no — whether this option loads into memory on every page request

The autoload column is the key to performance. Options with autoload = yes are loaded into memory on every single page load — before WordPress even starts rendering content. This is efficient for settings used everywhere (site URL, active plugins). But when plugins store large amounts of data with autoload enabled — transients, analytics data, logs, cached API responses — it bloats memory and slows down every request.

Healthy autoload benchmarks:

  • Under 800KB — Healthy
  • 1–3MB — Getting heavy, worth investigating
  • 3–5MB — Needs optimization
  • 10MB+ — Serious performance issue, fix immediately

Since WordPress 6.6, the core has automatic protection: options beyond a size threshold automatically have autoload disabled. But older sites that have been running for years often accumulate megabytes of unnecessary autoloaded data from plugins that were installed, configured, and removed — leaving their options behind.

wp_options in Practice

To check your autoload size, run this SQL query in phpMyAdmin or via WP-CLI:

SELECT SUM(LENGTH(option_value)) / 1024 / 1024 AS autoload_mb
FROM wp_options WHERE autoload = 'yes';

Common wp_options bloat sources:

  • Expired transients — Temporary cached data that was never cleaned up
  • Removed plugin settings — Most plugins do not delete their options when uninstalled
  • Cron data — The cron option can grow to hundreds of KB on busy sites
  • Session data — Some plugins store user sessions in wp_options

Optimization plugins like WP-Optimize and Advanced Database Cleaner can identify and remove orphaned options. For manual cleanup, always backup your database first — deleting the wrong option can break your site.

Why It Matters

The wp_options table is loaded on every page view. A bloated options table directly increases your TTFB and slows down your entire site. Keeping it lean — removing orphaned options, managing autoload settings, and cleaning up expired transients — is one of the most impactful database optimizations you can make.

Sources

Related Terms

Related Articles