How to Optimize WordPress Database Easily (and Safely) in 2026

Is your WordPress admin getting slow? Over the years your database fills with old revisions, spam comments, expired transients and leftover plugin data. When our own WordPress admin slowed down and our host started sending resource alerts, cleaning and optimising the database made a noticeable difference. Here is how to optimize WordPress database tables easily and safely in 2026.

Optimize WordPress database easily

Quick answer: Back up your database first. Then use a plugin such as WP-Optimize, Advanced Database Cleaner or the Database tool in LiteSpeed Cache to remove post revisions, auto-drafts, trashed and spam comments and expired transients, and optimise tables. Advanced users can run wp db optimize with WP-CLI or use phpMyAdmin’s Optimize table. Then limit revisions so the clutter does not return.

Step 1: Back up first

Always back up the full database before cleaning it. Use your host’s backup tool, a plugin like UpdraftPlus, or export from phpMyAdmin. Here is how to back up and restore a WordPress database.

Step 2: Clean and optimise with a plugin

  • WP-Optimize: one-click cleanup of revisions, drafts, spam, trash and transients, plus table optimisation and scheduled cleanups.
  • Advanced Database Cleaner: also finds orphaned tables and options left behind by deleted plugins.
  • LiteSpeed Cache: if you already use it, its Database menu cleans revisions, transients and optimises tables without another plugin.

What to clean

  • Post revisions: often the biggest clutter on older blogs. See how to delete post revisions.
  • Auto-drafts and trashed posts
  • Spam and trashed comments: or empty the trash automatically.
  • Expired transients: temporary cached data plugins forget to remove.
  • Large autoloaded options: data loaded on every page; tools like Query Monitor or Advanced Database Cleaner show the biggest ones.

Optimise tables manually

  • phpMyAdmin: select your database, tick all tables and choose Optimize table.
  • WP-CLI: run wp db optimize, and wp transient delete --expired to clear expired transients.

On modern InnoDB tables, optimisation reclaims less space than in the old MyISAM days, so cleanup matters more than the optimise step.

Prevent clutter

Add these lines to wp-config.php:

define( 'WP_POST_REVISIONS', 5 );
define( 'AUTOSAVE_INTERVAL', 120 );

Delete plugins you no longer use, and schedule a monthly cleanup in WP-Optimize or LiteSpeed Cache.

Does it make WordPress faster?

A lean database helps the admin area, search and uncached pages. For visitors, page caching matters more; see our tips to increase site speed.

FAQ

Is it safe to optimise the WordPress database?

Yes, with a backup and a well-known plugin. Avoid deleting tables you do not recognise unless you are sure they belong to removed plugins.

How often should I optimise?

Monthly for busy sites, every few months for small blogs.

What is “overhead” in phpMyAdmin?

Unused space left after rows are deleted. Optimising a table reclaims it.

How much did your database shrink? Share your results in the comments.

Stuck on a gift? Try our free Gift Idea GeneratorIdeas for anyone by age, job, interests and budget, with Amazon.com and Amazon.in linksFind gifts →

Found this useful? Share it with someone who needs it.

Get our free weekly email: new tech guides and tools, no spam.

New and updated tech guides, a free tool worth bookmarking and one useful pick, once a week. No spam, unsubscribe anytime.

One email a week. Unsubscribe anytime. See our privacy policy.

Related Tech Guides

Leave a Reply

Your email address will not be published. Required fields are marked *

2 Comments

  1. I have been looking at Yoast’s database optimizer for a while, wondering if it was worth trying. I think your post might have helped me make up my mind :)

  2. This is nice plugin . It will help us optimize our and boost our blog loading time automatically without any additional effort