All of the data in a WordPress site is stored in a database. A cluttered database can cost you SEO ranking and viewership by causing your site to load too slowly. Plus, all that useless information can cost you in backup storage fees by making your site files too big. Fortunately, there are two fantastic little WordPress plugins that you can use to cut the clutter in your database and keep it clean.
Slow Loads Cost You
When someone clicks a link to your site, the database has to search itself for the information before it can present the page to the viewer. A cluttered database slows down site load time, which is an SEO ranking factor. And, if your site loads too slowly, it can cost you the viewer, who will move on to another source for the info they seek.
Backup Storage Fees Cost You
Most free cloud storage services offer up to 5GB of space for free. Bloated databases cause big file sizes and you could be paying to store useless data if you keep more than one backup at a time before overwrite, which is the minimum you should keep. (Get the free report on How to Backup Your WordPress Site.)
The Causes of Clutter
The biggest contributor to wasted space in your database is something that WordPress auto-generates. Every time you create a post or page, WordPress automatically saves a revision so that if get disconnected, all of your work will not be lost. These revisions build up until you publish the post or page, creating a pile of useless files. The amount of revisions you build up depends on how long it takes you to create the post.
The two other culprits of database clutter are spam and unapproved comments that are sitting there doing nothing but taking up valuable space on your site.
Clean the Clutter
There’s a great little plugin called WP-Cleanup that will help you de-clutter your database. A screenshot is below.
The dark blue is what you want to see. That is useful WordPress data. The next lighter blue are the post revisions. Before I used WP-Cleanup for the first time, that segment was huge! This image is closer to what your database should look like when it’s having a good day. The lightest blue represents your unused MySQL Data, which is useless space taken up on your database.
In addition to the pie chart, the WP-Cleanup plugin also gives you a written percentage chart, shown below.
You can clearly see how much space your post revisions and unused MySQL data are occupying. These numbers are pretty low, but could be improved just a bit, and it’s easy to do.
How to Clean Up Your Database
Once you install the plugin, you’ll find the link for its admin page under Settings in the left sidebar of any of your admin pages. First, check the boxes next to all of the data you want to delete. Start with your post revisions, spam comment, and unapproved comments. Then click the blue Clean Up the Selected Items button at the bottom of the page. Once you do that, the Unused MySQL data percentage will increase by the same amount of data you just deleted. Next, check the box for Unused MySQL data and then click the Clean Up button. Now your database is de-cluttered.
Keep Your Database Clean
I really like the WP-Cleanup plugin, but it doesn’t run automatically, and the best way to keep your sparkling new database clean is to help it not get junked up in the first place. Install another plugin called Revision Control that will allow you to manage how many revisions WordPress saves while you’re creating a post or page. Once installed, the admin page can be found under the Settings link in the sidebar. It will be labled Revisions.
Now, here’s the trick. You can’t control how many revisions WordPress creates, only how many it saves. The screenshot below shows you the suggested configuration settings.
With the above settings, after five revisions have been stored, the next revision WordPress creates will overwrite the oldest revision saved. In other words, you will always have the five freshest revisions available.
The Revision Range setting allows you to select how many revisions you see in the Revisions module that appears below your text editor when you are creating a page or post. (Don’t worry if you don’t recall seeing this module. Most folks put it on ignore.)
The new Post Revisions module you’ll see will look something like the screenshot below (except that you’ll actually be able to read the information).
It will show you the date and time of the auto-save, the author, and allow you to restore to the post to one of the revisions.
Run WP-Cleanup Again
As the Revision Control plugin does its thing, it’s going to build up Unused MySQL Data. So, be sure to run the WP-Cleanup plugin once in a while to keep your database as de-cluttered and at its smallest size possible.