How to clean up a WordPress database

Having a good clean out helps things run better, faster and more reliably. So how do you clean up a Wordpress database? Find out what plugins will help.
Article by Simon Steed
Data Simplepage

Table of contents

What Wordpress Plugins Can I Use To Clean Up My Wordpress Database?

Having a good clear out from time to time is always a good idea, whether this is your office, your LinkedIn connections or your website. Wordpress is a content management system (CMS) which means unlike simple static websites that include just HTML text files, it has a database.

In our experience, the challenge business owners face with databases is you rarely see what’s in them! You see the website, and the website (Wordpress in this case) will be tasked with managing the data housed in your database. The problem here: Wordpress doesn’t know what your business needs are and so it actually can’t fully manage this in a way that is optimal for your business. Let’s look at some examples as to why.

Plugins and The Wordpress Database

When you install a plugin, this plugin will have it’s own set of database tables which get added to the ones Wordpress uses. The problem here: when you remove the plugin (because you’ve decided it’s no good for what you need) the database tables are usually left behind - even though they are not in use!

This means they sit there using up space and worse - over time, the database filling up means the whole website will start to run slower. Bear in mind, that the speed of your website is now taken into account in the Google rankings and visibility which will in turn affect the amount of traffic you get, and ultimately, sales.

Can your business afford the wasted space and performance? The good news is there are many things you can do to make this much easier to manage - which we will be detailing here.

First : Backup Your Database!

We see many businesses running without some kind of backup in place. Every website (such as Wordpress) with a database should have this in place already, if you don’t we will be writing more on how this can be done in the near future. But definitely back everything up before trying anything else in this blog post! You can export the Wordpress content itself as XML through the Wordpress dashboard, but usually your hosting provider will also have a some kind of SQL (database) backup and management dashboard.

Plugins and Tools to Clean up a Wordpress Database

  • Plugin Garbage Collector will search all your non-Wordpress tables (i.e. all those used by plugins) and attempt to list them, along with which plugin uses this table (if it can determine this). From this dashboard you can request the removal of any particular database table you are finished with.

  • WP Optimize is a nice simple plugin that will do a series of checks on your database: check the size, it can delete post revisions, remove auto-saved draft posts and clear spam comments. You get to select what it looks for and it takes care of the rest.

  • WP Clean Up similar to WP-Optimize, this plugin will help clean up auto drafts, revisions, auto saves. It also removes orphan revisions metadata (which can happen when using a feature of a plugin you then later remove - leaving options relating to the removed plugin).

  • WP Sweep is another great plugin that performs many of the similar tasks to WP-Optimise around removing old post revisions, auto saves and comments spam. It also identifies orphaned terms (for example, tags that are not used on any posts).

  • Advanced Database Cleaner offers all the tasks the other plugins do, with a few nice features: it can schedule tasks and has a lot of nice customisable options.

As you can see here, some of these tasks you can actually take care of manually without even needing plugins. When was the last time you check your comment spam?

Similarly, you can see right away which plugins are likely to present more of a challenge for your database: those that store a lot of content. For example, a petition or feedback plugin might gather quite a bit of text from the user, spambots and other entities.

These tools are particularly good for identifying the less obvious clutter that gathers ‘under the hood’ and ensuring you do a good job of completely cleaing out Wordpress’s database.

We hope this has been helpful, and if you are keen to let the experts clean up your website and give it a fresh bill of health, why not get in touch?