Remove spam comments to reduce the database size

I’ve talked before about how important it is to reduce the size of the WordPress database to make it more efficient, and showed two plug-ins recently to reduce the number of revisions  stored for each post in the database.

But there is another area that can grow in the database if you’re not careful, and that’s the spam comments.

Whichever system you use to block spam comments (e.g. Akismet), they still stay in the database in case they were a false positive and you want to recover them, at least for a while.

Luckily there’s a simple button in WordPress to remove those comments, once you’re happy that they don’t need them.

Step 1: Go to the spam comments

If the number of spam comments is shown in the dashboard, click on it:

8,817 Spam comments in WordPressIf you use Asikmet, then you’ll need to click on the spam queue link:

The spam queue using AkismetStep 2: Click on “Empty Spam”

Empty Spam

That’s it!

Akismet appears to tidy up the comments after a while anyway, but at least one site that I’ve checked recently had never deleted the spam comments ever – there were 4 years worth in there!

About Graham Tappenden

Graham Tappenden is a blogger from Germany. He has written code for WordPress themes since 2006 and been creating websites since 1994.
This entry was posted in WordPress Basics and tagged , , , . Bookmark the permalink.