Be it big blogs or small blogs with less posts, junk and unnecessary entry/data keeps on adding up in the database which ultimately slows down the database. For optimal performance of site, there is need to optimize WordPress database. In this tutorial, you will learn how to optimize and then cleanup WordPress database.
When it comes to database, we can say that it is the most complicated part of our site. Many of us who are not familiar with such things are hesitant to delve in editing database. One wrong move and you can face complete loss of data. Therefore, we’re not going to do anything manually in database, instead we’ll be using two plugins for this task.
Note: When it comes to database, we highly recommend that you first take backup of your WordPress database so that if anything goes wrong, you can safely restore your database.
How To Cleanup WordPress Database
Cleaning up WordPress database doesn’t mean that we are going to delete complete database, but it only means that we are going to cleanup database by removing all unused data from the database. For this purpose, we’ll be using WP-Cleanup plugin. After activating this plugin, you’ll be able to see a new menu under WordPress admin > Settings > WP-Cleanup.
Click on it and from here you can select what you want to clean up. You can select:
- Post revisions
- Spam comments
- Unapproved comments
- Unused tags
- Post meta
- Unused MySQL data
Select the options for which you want to perform clean up and then click on Cleanup the selected items. Wait for the process to finish up.
Optimize WordPress Database
To optimize tables of WordPress database, we can use Optimize DB plugin. This is a plugin by Joost de Valk, who is a famous WordPress developer. After activating this plugin, go to Tools > Optimize DB.
Now you’ll be able to see statistics related to database. It will also display how much the database can be reduced further. Click on Optimize Now button.
According to the description of this plugin, it will optimize the tables of your database, to reduce their overhead. With just one click you can optimize your WordPress database for faster performance.
With these plugins, you don’t need to edit anything in phpMyAdmin. Thus, you don’t need to worry about what database is and how it works. In the above tutorial, for cleaning up the database, we have used WP-Cleanup plugin and for optimizing the database, we have used Optimize DB plugin. Once you are done with both these plugins, you can safely delete these plugins.