WordPress website slow? Time to optimise your database

08 July, 2013 by Tom Elliott

Without good housekeeping, it won’t be long before you start to notice the general speed of your WordPress website begin to get a bit sluggish. This slow down in page load speed may not be that noticeable at first – just a few milliseconds perhaps – but it will only get worse unless you optimise your WordPress blog database.

I’ve seen many WordPress sites, including Web Dev Door, that over a period of time have gradually started to slow down. This is often caused by bloating of data in the most actively used WordPress database tables – the ones that deal with posts/pages and comments.

Comments held in trash and SPAM can often add to database bloat, but so can post and page revisions. Whenever you make an edit to a post, no matter how small, a new version of the post will be saved as a new row in the post table. Although this is a great feature as it allows you to restore previous versions of the post, it can also quickly fill your WordPress tables with (largely) redundant data, slowing down the speed of your site.

Here are a few things you should do regularly, I’d recommend at least once a month, to keep your WordPress website optimised:

  1. Empty your SPAM comments and delete comments in your trash
  2. Delete old post or page revisions
  3. Optimise all tables in the WordPress database

There are a few plugins that can help with these points but the one I usually use is ‘WP Optimize‘. Once installed, a new menu option will appear that will allow you to purge all spam comments, delete all unused post revisions and optimise database tables.

Hopefully your website page speeds should now be noticeably faster, especially if you’ve had your WordPress site a while and not run any sort of database optimisations before.

If you want to further improve your blog’s page speed, check out my guide on how you can improve your website’s PageSpeed score.

19 ways to improve the speed of your WordPress website »
Improve a WordPress website Page Speed by 50% in 5 minutes »