If you are an experienced WordPress user who has run a WordPress site for a while, it is a critical task for you to clean up your website database, for the database might be full of the unnecessary tables that will make your website bloated and sluggish. In addition, as you may backup your site regularly in case of any wrong situation, the cleanup of your database can keep the backup files smaller and the backup process quicker.
In the following, we have listed the best 10 tips to keep the clean WordPress database. With them, you can reduce the size and scale of the website database effectively. Before everything, you should do the most basic housekeeping of website backup. Thus, you can restore the whole site is a flash if something goes wrong.
Tip 1 – Remove All Your Unused Plugins
One of the most effective ways for database cleanup is the removal of all the unused plugins. It is possible that you have installed some unnecessary plugins to achieve the goals during a specific period of time. Also, we have found that many webmasters are likely to install a lot of plugins for the testing purpose, but forget to delete them.
In this case, when it comes to the database cleanup, the first thing you should do is the plugin removal. Due to the user-friendly dashboard of WordPress, you can do this in a much easier manner.
Tip 2 – Delete All the Spam Comments
Without doubt, the spam comments can be regarded as the unnecessary clutter that you should delete and remove in a regular interval. After all, these words can do no good to your WordPress site. However, they can take up a large portion of your database with the growth of the website.
If you have the habit to clean up the spam comments on a weekly or even a daily basis, it is fine to do this in a manual way. However, if you haven’t done this routine for a long time and the spam comments on your site are too many, you can consider the Spam Comments Cleaner plugin. With it, you simply need to click the Delete Spam Now button to have these bad words deleted in batches. Even, you can schedule the removal in the hourly, daily, weekly and monthly frequency.
Tip 3 – Check the Pending Comments
In addition to the comment spam, you also need to check your comment section, and then, approve the genuine ones and delete the bad ones that are awaiting moderation.
Tip 4 – Remove All the Post Revisions and Some Old Drafts
This practice can cut down the size of your WordPress database to a large scale. Actually, WordPress has an advanced feature of auto saving your posts. With it, your words can be saved automatically in different editions when you edit the content in the editing screen and when you click the Save Draft button. Surely, with the saving of multiple editions for your blog post, you can avoid the sudden issue of content loss. Especially, this feature is great when your site is losing the online connection. However, if each or most of your posts have several revisions, your database will face the huge burden.
In this case, removing the redundant revisions for your blog posts and some old drafts needs to be a regular routine for you. For this, you can use the Better Delete Revision plugin. With this plugin, you simply need to follow three steps to clean up all the unnecessary post revisions.
- Click the Settings > Better Delete Revision button.
- Hit the Check Revision Posts button.
- Click the Delete Them link.
Tip 5 – Get Rid of the Unused Tags
This tip is likely to be ignored by most WordPress users. However, the truth is that you might be surprised at the number of unused tags found on your site. For this, you can click the Post > Tags button. And then, after sorting the tags by the number of blog posts and pages they are attached, you can find the unused ones easily.
If there are just a few ones, you can get rid of them on your own. However, if you find a massive number of options, especially when you have deleted a large number of posts, you’d better use the Mass Delete Unused Tags plugin.
Tip 6 – Delete All the Pingbacks and Trackbacks
To put it simply, both the pingbacks and the trackbacks can be viewed as the special features to help bloggers communicate and comment among the websites easily. The only difference is that the trackbacks send the content excerpts manually while the pingbacks work in an automatic way but do not send the content.
Personally, both of them are the hot carriers of spam and take up your database storage. In this case, we highly recommend you to remove them using your WordPress dashboard from the Comment section.
- To search for the trackbacks, you only need to enter the “[…]” in the Search Comments box.
- To search for the pingbacks, you can click the Pings button in the filter box.
After finding the targets, you can click the Move to Trash button to have them deleted.
Even, you can totally turn off these two features by going to Settings > Discussion. Here, you can uncheck the second checkbox in the Default Article Settings part.
Tip 7 – Dump All the Unused Shortcode
It is possible that you have previously used a plugin with the exclusive shortcode required. However, if you do not want to use the plugin later, you may remember to delete the plugin but forget to clean up the shortcode that actually can do nothing for your site but takes up some rooms of your database. Even, this is the same case for your unused WordPress template.
For this, you can leverage the below SQL query for dumping all the instances of the unused shortcode.
Tip 8 – Remove the Unused Images and Media
To better enrich your blog post contents, you may have uploaded a lot of images or some media components. However, not all of these uploaded items are used by you actually. In this case, you should identify and remove the unused options in a thorough manner. Frankly speaking, as compared with the normal textual contents, these components generally take up much more spaces of your WordPress database.
For this cleanup tip, we think the Image Cleanup plugin can be your first choice. After clicking the Tools > Image Cleanup button, you can hit the Index Images button to target the images for removal.
Tip 9 – Optimize the Database Tables
This practice can be done using the phpMyAdmin. Here, you simply need to hit your database name, and then, click the Check All box at the bottom section. Here, you can find the Optimize Table option from the drop-down list. Frankly, the optimization of the tables is another effective way to free up more database spaces.
Tip 10 – Optimize Your Database using the Plugin
This is the last tip for the cleanup of your website database. After all, the optimization of WordPress database can delete all the overheads, remove the data bloat and reduce the database size effectively. For this part, the most proper plugin is WP-Optimize. With it, you can start the database optimization comprehensively.