Pay For Results. Our new Performance Model is live.

WordPress Database Optimization: Find the One Table Causing It

A slow WordPress database is usually one table that grew without limit, not the database as a whole. How to find it in five minutes, and the log, cache, queue or live state question that decides what you may safely delete.

Picture of Adam Walters
Adam Walters

Founder

One table. A slow WordPress database is usually one table that grew without limit, not the database.
IN THIS ARTICLE

Most advice on this topic tells you to install an optimisation plugin and click a button. That is not wrong, but it treats every database the same, and it almost never explains the actual problem.

A slow WordPress database is usually one specific table that grew without limit, not the database as a whole. Finding which one takes about five minutes and tells you far more than any plugin summary.

Ask One Question First: Log, Cache, Queue or Live State?

This is the single most useful idea in database maintenance, and almost nobody says it out loud. Before you delete anything, work out what kind of thing the table holds. There are four kinds, and the correct action is different for each.

TypeWhat it holdsCorrect actionExample
LogA record of what already happenedSafe to empty. You lose history, nothing elseWordfence traffic and file-change logs
CachePrecomputed data the site reads liveRebuild, do not truncate. Emptying it degrades output until it refillsYoast SEO indexables
QueueWork that has not run yetDelete only finished or failed rowsAction Scheduler
Live stateWhat someone is doing right nowDo not touch. Delete only what has expiredWooCommerce sessions
Get this wrong and you can empty every guest cart on a store, or blank your SEO metadata, while believing you performed maintenance.
Comparison showing logs are safe to empty while caches, queues and live state must not be truncated

The Tables That Actually Cause This

In practice the same handful of tables are responsible almost every time. Each of these has a specific cause and a specific fix:

TablePluginWhy it grows
wp_wfHitsWordfenceLive Traffic set to log everything, so every bot request writes a row
wp_wfFileModsWordfenceScan scope too wide, so every scanned file produces a record
wp_yoast_indexableYoast SEOOne row per post, page, term, author and archive, plus rows orphaned by deletions
wp_actionscheduler_actionsWooCommerceFailed actions were never purged before Action Scheduler 4.0.0
wp_woocommerce_sessionsWooCommerceThe cleanup event stopped running, so expired sessions accumulate
wp_optionsWordPress coreAutoloaded options load on every single request, and plugins leave theirs behind after removal
We have written each of these up in detail. Links below.

The last one deserves a note because it behaves differently from the rest. Options marked to autoload are read on every page request, so a bloated autoload set slows the whole site rather than one feature. Uninstalled plugins routinely leave their options behind, still autoloading, years later.

One database table is normally responsible for WordPress slowness rather than the database as a whole

How to Find Your Actual Problem in Five Minutes

  1. Open phpMyAdmin or your host database tool and sort tables by size. Do not skip this. The answer is nearly always visible in the first three rows.
  2. Identify what the largest table belongs to, using the table above. The prefix tells you the plugin.
  3. Classify it: log, cache, queue or live state. That decides what you are allowed to do.
  4. Fix the cause before clearing the table. A setting left unchanged refills it within weeks.
  5. Back up, then clear only what is safe for that type.

If your largest table is not on the list, the same method still works. Find the owner, classify it, fix the cause.

What Optimisation Plugins Do and Do Not Do

Database optimisation plugins are useful for the routine housekeeping: clearing post revisions, expired transients, spam comments and orphaned metadata. Run one on a schedule and it will keep that clutter down.

What they will not do is tell you that Wordfence is logging every bot request, or that a WooCommerce cleanup event stopped firing four months ago. Those are settings problems, and a plugin that deletes rows will keep deleting the same rows forever without ever mentioning why they keep coming back.

For what it is worth, we keep our own stack deliberately small and publish all of it, affiliate links and all, on our tools page. Caching and hosting do more for perceived speed than database housekeeping ever will, which is why those two get the budget. One genuine warning: several of these plugins offer to optimise or repair tables in ways that are not always safe on live sites, and some will happily empty a table that is not a log. Take a backup you have actually restored before letting any tool operate on the database.

Read the Detail on Each Table

Each of these covers one table properly, including the exact settings that control it:

If your biggest table isRead
wp_wfHitsWhat the wp_wfHits table is and how to shrink it
wp_wfFileModsWhat wffilemods is and whether you can empty it
wp_yoast_indexableWhy you should rebuild rather than truncate Yoast indexables
wp_actionscheduler_actionsWhy the Action Scheduler table gets huge
wp_woocommerce_sessionsWhy the WooCommerce sessions table reaches gigabytes
If the site is also hitting storage or file count limits, see reducing inode usage.

Running low on files rather than space is a related problem with a different fix: how to reduce inode usage.

Keeping It From Coming Back

Database size is a lagging indicator. It grows for months before anyone notices, which is why it belongs on a schedule rather than in a panic. A quarterly check of the largest tables catches every problem on this page long before it affects a visitor.

That check is one line on our website maintenance checklist, and it is part of what managed WordPress hosting covers.

WordPress Database Optimization FAQs

What makes a WordPress database slow?

Usually one specific table that has grown without limit, rather than the database as a whole. The most common culprits are security logs, SEO caches, scheduled task queues, session tables and autoloaded options in wp_options. Sorting tables by size in phpMyAdmin normally reveals the answer in the first three rows.

Is it safe to delete rows from a WordPress database table?

It depends what the table holds. A log is safe to empty because it only records what already happened. A cache should be rebuilt rather than truncated. A queue holds work that has not run yet, so delete only finished or failed rows. Live state, such as WooCommerce sessions, should not be touched except for expired rows. Always back up first.

Do WordPress database optimization plugins work?

They are good at routine housekeeping such as post revisions, expired transients, spam comments and orphaned metadata. They will not tell you that a plugin setting is causing a table to refill, so they treat the symptom rather than the cause. Some also offer repair operations that are not always safe on a live site.

What is autoload in wp_options and why does it matter?

Options marked to autoload are loaded on every single page request. That means bloat there slows the entire site rather than one feature. Plugins commonly leave their options behind when uninstalled, still autoloading, long after the plugin itself is gone.

How often should I check my WordPress database?

Quarterly is enough for most sites. Database size is a lagging indicator that grows quietly for months, so a scheduled check catches problems long before a visitor notices anything. Sort tables by size and confirm nothing has grown out of proportion to your content.

My site got slow and nothing changed. Why?

That description almost always points at database growth, because it happens gradually with no event to point at. Check the largest tables first. A log or session table that nothing is purging is the most common single cause.

If sorting your tables by size produced a number that surprised you, that is worth acting on before it becomes a slow checkout. Tell us about your site and we will tell you what is actually going on in there.

Is your competitor stealing traffic?

Get a free competitor spy report. See their keywords, backlinks, and map rankings.

SHARE:
There is no market rate for a lead. There is only the price your own…
August 27, 2026
A shared lead has a lower sticker price and a lower close rate. Which one…
August 27, 2026
Yelp bills by the click, not by the lead. That single difference changes the arithmetic,…
August 27, 2026
Get the Blueprint

Join 5,000+ local business owners receiving weekly growth tactics.

Performance Partner Application

We invest our own capital to generate your leads. To ensure this partnership is profitable for both of us, we need to verify a few details about your business.

Let's Connect.

Have a specific question or need a custom proposal? Fill out the form and our team will get back to you within 24 hours.

Get Your Free Audit

See where you stand before you launch.