A comprehensive database for everything WordPress related.

WPKlik Logo Newsletter

Sign up and receive a free copy of How to Create an online Store with WooCommerce (full guide)

How to Optimize Your WordPress Database

How to Optimize Your WordPress Database

If you want your website to be fast, then optimizing your WordPress database is essential for maintaining its best possible performance. Not only is WordPress database optimization necessary because it gives better user experience to your visitors, but having a fast website can also help rank it higher in the search results.

As this can be a bothersome process, we’ve decided to show you two ways in which you can easily optimize your WordPress database.

Using phpMyAdmin

This method is one of the most favored among website owners. To access it, go to your cPanel and click on phpMyAdmin in the Databases section.


First, you need to login to your phpMyAdmin. Once there, you will be able to see a list of all tables in your database and their sizes. The size of all these tables is equivalent to the size of your data. If you have plenty of stored data, there will be more rows in one table. This also means increased size of your database.

In order to optimize your database, you need to select these tables. You can do so by marking the checkboxes that appear next to every table name on the left. Then, find the option called Optimize Table in the drop-down menu and hit the Go button.

Optimize Table

Using a WP-Optimize plugin

If you would rather use a plugin that will take care of the task of optimizing your WordPress database for you, then WP-Optimize plugin is more than capable of doing the job.

WP Optimize plugin

Once you install a WP-Optimize plugin, a new tab with the name WP-Optimize will appear in your Dashboard.

WP Optimize in Dashboard


You can access the Optimizations screen from the Database tab. On the picture below you can see all the checkboxes you can mark in order to optimize your WordPress database.


When you install and then change the settings of your themes or plugins or even delete them, it leaves traces in your database. Optimize database tables option is particularly important because it helps with the cleaning of those traces.

If you have a blog-based website, there is no need for you to keep all site revisions. Therefore, it would be of significance for your site to clean them by checking the Clean all post revisions option.

When deleting unwanted content such as posts or spam comments, many people forget to remove them in their entirety. Clean all auto-drafts and trashed posts and remove spam and trashed comments options are great for this task. And speaking of comments – it is also desirable to remove unapproved comments while you’re at it, as there is an option for this category as well.

At the end of the optimization list, you will notice the options that contain an exclamation point. We advise you to tread carefully with these particular options. This is because items marked with this icon carry out more demanding tasks. Therefore, if for some reason your server crashes or some other problem occurs while the optimization process is running, it could result in corruption of your data. That’s why we implore you to back up your database first before using these options.

When you finish selecting optimization options, you can either click on Run all selected optimizations or Run optimization to perform each task individually.

Run Optimization


If you like the way that this plugin performs the process of database optimization, you can schedule it to run automatically. To do so, go to WP-Optimize > Settings.

  • Keep Last… – by marking this checkbox, you will set a time period during which the data has to be kept. This means that everything created after a two week period can be optimized, while everything that falls under the last 2 weeks category will remain untouched.
  • Scheduled clean-up settings – this option lets you decide how often the optimization will take place, as well as which categories in particular will be optimized. The last two options carry the same exclamation point as the previously mentioned options, which means that they also perform more demanding tasks. Hence, the same rule of backing up your database applies to them as well.
Clean Up Settings

It is important to note that this plugin also gives you an option to Enable or Disable any future Trackbacks and Comments.

Trackbacks and Comments

Once you’re done with setting up all your options, make sure to Save settings.


Tables option in the Database tab lists all the tables in the database, both those that are currently being used and the ones that have been used before. Instead of doing the optimization process (which we’ve already explained above), here you can see if there is any unwanted table item and then delete it manually. But if you did decide to go with the above options, then it is most likely there won’t be any excess or junk items present in this list.

Table Option

What you get if you decide to buy a pro version

As with many plugins, there is an option of using the free version as well as upgrading to pro. With buying a pro version of WP-Optimize plugin, you get multiple benefits, such as the ability to perform optimizations on single tables and remove images you’re no longer using. In addition, you get to try out a more advanced scheduling system that allows you to make routine optimizations whenever you deem fit, among other things. You also get an option of multisite support, which means that you will be able to optimize any site that you have on your WordPress network. Last but not least, the privilege of contacting the plugin’s support team will also be included if you go pro.

We hope this article was helpful. If you liked it, feel free to check out some of these articles as well!


WordPress perfection at your fingertips.

If you enjoyed this article, feel free to subscribe to our newsletter using the form below. You can also follow us on Facebook and Twitter and subscribe to our YouTube channel for WordPress video tutorials.

Leave a Reply