The Beginners’ Guide – How to Block WordPress Comment Spam

The Beginners’ Guide – How to Block WordPress Comment Spam

Blog spam is becoming an issue for all websites, and you can hardly clear it out even using anti-spam software like CAPTCHA and Akismet. Besides, it often takes too long to delete hundreds of thousands of comments when clicking the built-in “Empty Spam” button.

In the following, we will introduce three best approaches to mass delete spam comments inside your WordPress. Before making any changes, it’s best to make a full backup of your WordPress database.

Approach 1 – Delete Spam Comments Using phpMyAdmin

One method you may use to get rid of spam comments is available in the MySQL manager, namely phpMyAdmin. Taking cPanel as an example, just scroll down to “Database” column and hit on the “phpMyAdmin” icon to access your MySQL database.

Access phpMyAdmin Manager

Here, enter “SQL” tab and then expand “wp_comments” table to view the contents. Till now, you will be able to remove WordPress comment spam where comment_approved=”spam”. To delete pending and approved comments, just delete from the same “wp_comments” table where comment_approved=”0″ and comment_approved=”1″ respectively.

Delete WordPress Comments via phpMyAdmin

Note: In case you’d like to delete all comments, simply press the “Empty” button directly. In some cases this phpMyAdmin is not integrated with your hosting panel, here is a much safer and simpler solution – SQL Executioner. This plugin not only enables you to confirm the comments table by clicking this “Scomments” link, but also lets you perform arbitrary SQL queries without inherent limitations.

Use SQL Executioner

Approach 2 – Using WPCommentCleaner Plugin

The second recommendable way is to use the WPCommentCleaner plugin to bulk delete spam, un-approved and approved comments. Instead of requiring SQL command, this simple plugin operates the spam comment deletion process straight from the admin dashboard. It is fully compatible with WordPress 2.8 or higher versions.

Plugin URL:

About WPCommentCleaner Plugin

Once installed and activated, a new “CommentCleaner” menu will be included in the sidebar as follows. Just mouse over it and a “WPCommentCleaner” column will appear onscreen. Depending on personal needs, it’s possible to mass delete “Un-Approved”, “SPAM” as well as “Approved” comments via the “Delete” button. Please note that this deletion action requires your confirmation, and a success message will show up if done correctly.

Use WPCommentCleaner Delete Comments

Approach 3 – Using Batch Comment Spam Deletion Plugin

This Batch Comment Spam Deletion plugin comes handy to those who want to perform this comment deletion task without overloading the web server. Besides, this plugin requires no further customizations, and you can remove the spam messages in bulk directly through the “Empty Spam” action. Usually it allows you to see the whole deletion process and will redirect you to the “Comments” page if everything is done.

About Batch Comment Spam Deletion

Usually this tool processes spammy comments in bulk and will delete 100 visitor comments at one time. However, you can set the default value 100 to a much lower number by entering the “Edit” page of this plugin. Remember to “Update File” at last.

Change Default Value 100

Note: Plus, an effective way to prevent visitors from submitting spammy comments and backlinks is to make user registered. To do that, go directly to “Settings” > “Discussion” and check the option saying “Users must be registered and logged in to comment” there.

Make User Registered in WordPress

Meanwhile, make sure that you would uncheck the box of “Anyone can register” via “Settings” > “General”. For more practical suggestions, refer to this guide.