Best plugins to clean up and optimize WordPress database and tables

A database is a structured set of data which stores different kinds of information. Before you can even install WordPress, you will have to create a database (or software will do to that for you if you’re installing WP from cPanel, for example). By default, WordPress needs eleven tables in that database to store viable parts of your future posts, taxonomies, users, comments, etc.

Once you start upgrading your site with new plugins and themes, the number of tables keep on rising and the database keeps on getting larger and clunkier. On one of our local servers that we use for testing themes and plugins, we found more than seventy tables! Imagine how much tables are on your hosting server if you have been using WordPress for years.

Most users get aware of that only when they experience a slower site. The problem gets even bigger if you tend to install numberless themes and plugins. Unfortunately, even if you deactivate and delete most of the themes and plugins, they will leave the unnecessary tables in your database. And before you know, you can get up to a hundred tables which slow you down. Before you get to that, you should always keep in mind that WordPress needs maintenance. Just like you would optimize your computer hard drive or photos that you put on the web, you should clean up and optimize WordPress database from time to time.

Don’t worry; although a word “database” might sound terrifying to someone who has no experience with coding (and believe us, it may become even more terrifying when you start working with queries on a regular basis), cleaning and optimizing WordPress database isn’t that hard. In this article, we’re about to show you how to quickly defragment a database with phpMyAdmin. Then, we will show you some of the best WordPress plugins which will clean up and optimize WordPress database in just a few clicks.

Quickly optimize WordPress database with phpMyAdmin

While you’re using WordPress, you might not even be aware of the processes going on in the background. Queries to the databases run like mad, tables come to existence and they get deleted, fields keep on changing on a daily basis. If you’re just using WordPress to write your blog, you don’t even have to think of all that, but the truth is that every action fragments the database and new information makes it slower to load. By looking for pieces to complete new tasks, everything becomes slower and you just have to clean up and optimize WordPress database.

Quickly optimize a WordPress database with phpMyAdmin

Before we start with the list of plugins, let’s quickly see how to clean up and optimize WordPress database manually. This might come in handy from time to time so it won’t hurt to remember this simple process.

Before you start fiddling with the database, make sure that you create a WordPress backup.

  1. Log in to your cPanel
  2. Navigate to Databases category
  3. Open phpMyAdmin
  4. Choose your WordPress database on the left side
  5. Scroll down under the list of tables
  6. Click on the Check All button
  7. From the “With selected” list, choose Optimize table

Even if you have a larger number of tables, the process shouldn’t last more than several seconds. Some tables will be successfully optimized, while some may be skipped, but you shouldn’t worry about that. You’ve just successfully optimized your database.

Best plugins to clean up and optimize WordPress database

Even though you can quickly defragment a WordPress database through phpMyAdmin, there are some fantastic WordPress plugins which can do a much better job. First of all, you won’t have to manually search for the database nor the tables. Secondly, the plugins will give you extra options that will help you do a much better clean up.

Before running any of the plugins for the first time, it’s crucial that you create a WordPress backup or choose one of the best backup plugins.



WP Optimize

With more than half a million active installs, WP-Optimize is one of the most popular plugins dedicated to cleaning up and optimizing WordPress databases. And there’s a good reason for that.

The plugin is free, and it is excellent at its job. It can remove all unnecessary data from your WordPress database. That includes comments that you no longer need, pingbacks, trackbacks and even expired transient options. WP-Optimize will defragment the tables and let you control optimization in details.

We loved the option to schedule database cleanups; by doing so, you can relax and forget about the database for some time. The plugin will do the job for you. WP-Optimize is mobile-friendly, easy to use, and it can even display statistics. If you want to clean up and optimize WordPress database, this plugin is a must-have.

Advanced Database Cleaner


Advanced Database Cleaner

Although not nearly as popular as WP-Optimize, Advanced Database Cleaner is another great free plugin that can help you with WordPress database maintenance.

It will easily remove all unused data from the table which includes drafts, revisions, unnecessary comments, post meta, comment meta and much more. The plugin allows you to choose the data you want to delete so you can have the total control over it. After cleaning the database, Advanced Database Cleaner will optimize it as well. And the great part is that you can schedule cleanups and optimizations to run automatically.

The plugin supports multisite installations which is a feature that every network admin will love.




As the name of the plugin already suggests, WP-DBManager is an excellent candidate to help you with WordPress databases. With more than 100,000 active installations, we can say the plugin is quite popular among WordPress users. And here’s why.

WP DBManager let’s do practically everything you can do with a database. It will clean up and optimize WordPress database. It can repair, restore, and backup a database. If even that isn’t good enough for you, you can delete the backups, drop/empty tables and run selected queries directly from the plugin.

Yes, WP-DBManager also allows you to schedule the processes.

Optimize Database after Deleting Revisions


Optimize Database after Deleting Revisions

Want a one-click solution for your WordPress database? Then you should check out this free plugin.

Similarly to the previously mentioned plugins, Optimize Database after Deleting Revisions will delete unwanted comments, revisions, tags, expired transients, and much more. After the cleanup, the plugin will do its magic and optimize the database so it can work faster. If you want more control over the optimization, you can quickly exclude tables or specific posts and pages.

The plugin can create a log file, and schedule optimizations to run automatically. Still want that one-click optimization? You can find the button in the admin bar and the admin menu. In the end, it’s important to mention that the plugin is multisite compatible.

Smart Cleanup Tools

PRICE: $30

Smart Cleanup Tools

This premium plugin contains 39 cleanup tools that will work together in order to speed up your WordPress site. Although you can use tools one by one, Smart Cleanup Tools lets you use them all at once just by clicking a button.

As the developer notes, the plugin works best after several months of database use. By allowing some time to pass, the plugin will be able to remove and compact the data and make your WordPress database smaller and faster.

To see the list of all the tools, please visit the official site.

Start Blog Book


This guide is an introduction to mastering the art of blogging. It provides easy to follow steps to start, maintain, and grow your blog.

Read the guide

One thought on “Best plugins to clean up and optimize WordPress database and tables

  1. You forgot about WP-Sweep, I think it is one of the best, made by the famous Lester Chan. It is free and comes with cleaning and optimizing….everything.

Leave a Reply

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