Do you have a WordPress site and are having trouble with the large number of spam comments being posted and not being able to delete them, or spam comments not stopping being posted?
In this article, we will explain the countermeasures against spam comments based on a case in which we responded to spam comments at the request of a customer.

I don’t want to disable the comment function, but I want to stop spam comments from being posted.

The comment feature in WordPress is a very useful feature for receiving responses and questions about articles. Therefore, many webmasters do not want to turn off this feature, but would like to remove unapproved spam comments that continue to accumulate in WordPress and stop them from being posted. We will explain how to do this.

*Please refer to the following article to learn how to stop all writing functionality of the comments themselves
How to disable comments on all posts in WordPress

Make the publication of comments subject to approval

First, please make sure that your comments are set to Approval Only by going to Manage Comments > Settings > Discussion.
If this is not checked, spam comments will be posted immediately on the site, and it will be difficult to separate them from the original comments when deleting them later.

Newly posted comments are stored in the comments menu of the administration page, so please approve them there. (Once you approve a user, you do not need to approve them again.)

Delete all unapproved comments at once

There are two ways to delete unapproved (spam) comments in bulk. One is to delete comments directly from the database by issuing SQL statements, and the other is to use a plugin.
In this article, we will explain the easy method using a plugin. We recommend that you backup your WordPress database before proceeding.

Go to “Administration” > “Plugins” > “Add New” and search for the ” Delete All Comments Easily ” plugin, install it, and activate it.

Then go to Administration > Tools > Delete All Comments Easily,
Check the “Delete all pending comments” checkbox and click the Delete all pending comments button at the bottom. This will delete all unapproved comments at once. Deletion is instantaneous.

If you wish to delete all comments, check “Delete all comments” and click the Delete all comments button.

Preventing and defending against spam comments

Next, take measures to prevent the number of spam comments from increasing in the future.
Please install and activate the plugin Anti-spam.
This plugin, just by inserting it, determines whether a comment is spam or not when it is posted, and prohibits robots from posting spam.

There is also a plugin called Google Captcha (reCAPTCHA) that prevents comment spam by adding a quiz-like item (captcha) to the comment field.

The above plug-ins require pre-registration for Google reCaptcha (captcha service, free of charge).