What's WP
Our everything is about WordPress - best choice of WordPress users!
How to Prevent WordPress Comment Spam

How to Prevent WordPress Comment Spam

According to the algorithm used by many search engines like Google, the popularity of the URL contributes a lot to the implied value of a website, so many spammers raise their search engine rankings by adding links to your site that link back to their own websites. The most effective and common place to do this is your comment section.

In fact, having some comments on each of your webpages can be a great thing, but the spam ones just can cause some disasters. After all, Google crackdowns bad links, and your readers may lose faith in you if they see a lot of spam comments on your site.

Now, the question is how to identify and prevent WordPress comment spam? In the following, we have listed some best useful strategies. Note that spammers use many tactics and keep them updated, so you’d better carry out multiple defenses recommended by us.

How to Identify It?

How do you know which comment on your site is a spam one? This is easy to figure out, but is a little bit time-consuming.

Simply go to your WordPress admin panel and scroll down to the comment section. Then, you can see a list of comment information that includes author, content, and the original post. At this time, you’d better pay attention to the comments that are published by the same author, or those that contain links, for they are very likely the spam ones.

WordPress comment

How to Prevent It?

There is no shortcut to identify SEO spammer, and you can only filter them manually. Thus, you need to take some precautions to prevent them from destroying all your efforts put into the website.

Restrict the Number of Links in One Comment

The ultimate aim for spammers to put bad comments on your site is to promote their own sites, so they are very likely to include dozens of links in their comment posts. By default, WordPress allows 2 links, so you can lower this restriction to only one or even zero to meet your need.

To change the setting for the number of links allowed in one comment, you only need to do 3 steps.


  • Go for your WordPress dashboard and scroll down to Settings > Discussion panel
  • Click on Comment Moderation section
  • Change the default number of 2 to 1/0

If people include more links into the comment, which exceed the number of that input box, then this comment will be held for moderation automatically.

Forbid Spam Words

According to the spammer identification process, you might have some spam words or phrases bearing in mind. Thus, you can include them in the Spam Words list that comes with your WordPress installation.

  • Go to the Comment Moderation panel located at the Settings > Discussion section
  • Add spam words into the Spam Words text area box

Now, every comment that contains any of these words in the content, URL, or email address will be blocked in WordPress moderation queue for you to check.

Add Spammers to Blacklist Box

anti spammersTo reduce spam comments, you can also make some configurations in the WordPress dashboard. Open Settings and click on the Discussion tab to find blacklist box. Type the name, IP, email address or URL of the spammers to add them to blacklist.

Sometimes you may be unsure whether one is a spammer or not, and thus want to moderate their comments. To this end, you can enter their URL, IP or other details on the Moderation Box just above the blacklist box. From here, you can moderate and approve their comments.

Ensure that you put the details of the person to blacklist correctly as their details can be deleted instantly.

Moderate Comments from New Authors

After making sure that all the comments of your site are not the spam ones, you need to pay attention to the new comments, especially those posted by new authors.

To do this, simply configure your Discussion settings, requiring that comment author must fill out name and e-mail. Generally, spammers will not waste their time and energy to do this, and may leave your site at once to go for some other targeted websites.

Besides, you can also decide that before a comment appears, the author must have a previous approved comment.

comment settings

Close Comments on Old Articles

It is unavoidable that you may lose some spam comments on your old posts, so you’d better automatically close comments on these articles. WordPress has a default feature to help you decide the number of days. All you need to is to go to Settings > Discussion, check the box like the image showed below, and change the number.

close old comments

Make Use of Verification Code

Captcha verification is very useful to prevent comment spammers. After all, only positive comment authors who really want to leave something valuable in your website will spend their times to pass this testing.

To use this technique, you can make use of some WordPress plugins like SI CAPTCHA Anti-Spam. After installing and activating it successfully, anyone who are willing to comment on your site have to enter the correct code showed on the image before summiting their words.

Verification Code

Use Defensio

use defensioThis is an automated system that catches all the comments, analyzes them and grades them depending on the level of spam content. Comments that get good grades are published while those that perform poorly are held for your moderation. It also provides you with comments stats; both good and spam comments.

Math Comment Spam Protection

This is more or less like Captcha verification, but is less annoying to your good commenters. It requires you to edit comments.php and then install the plugin. This plugin is as effective as Captcha verification in spam reduction for your WordPress site.

Pay Attention to Trackbacks

According to our investigation, a large portion of spam comments are trackbacks. If the IP address of the trackback author is not the one that the trackback URL is referring to, then this is a spam trackback.

To be honest, for many websites or blogs, it is not necessary to have trackbacks. We highly suggest you turning off this function for your entire site or some certain webpages. You can configure this part through Settings > Discussion.

For your convenience, we select an excellent trackback validation plugin. This plugin is for WordPress 2.x or greater. It is simple but efficient in curtailing spam comments by testing all trackbacks to ensure that the site does not get trackback spam.

It compares the IP address of the sender and the IP address of the trackbacks’ web server. This method is 99% effective since spammers prefer the use of bots. It also checks whether the webpage on the trackback is related to your content. If not, the trackback is identified as deemed spam.

trackback validation

Close Comments Temporarily

If you have adopted the above mentioned tips, then things will rarely go that bad that requires you to close the comment section. However, if it really happens, simply disallow people to leave words on your webpages for a short period of time, driving spammers away from your site effectively.

How to Reduce It?

It must be annoying for WordPress user to find hundreds of spam comments on the blog site. This means either of two things – Just delete the spam comments one by one, or let them stay until they reach the limit and go automatically. However, the latter option has an impact on your blog performance and thus leaving you no option than to delete them.

Use Akismet Comment Spam Fighter

Askimet is a WordPress pre-installed plugin. The current version of WordPress has this tool installed by default, so you don’t need to download it, but need to activate this plugin to get an API key from Akismet.com. Akismet will add a menu to your Comments Panel with a list of caught spams. Don’t delete them but marking them as comment spam, thus Akismet can add these bad words to the community-created database.


How to Easily Delete It?

Even if you spare no effort to prevent spam comments, you can not ensure that there is no spam comment on your sites. Besides, in view of the limited energy and time, it is inevitable to leave out some disturbing comments. With the ever-increasing spams, every website may get loads of spam comments on a regular basis if the configuration doesn’t ask for authentication. The presence of spam in the comments section influences the website ranking and quality greatly. Listed here are the most-suitable ways to delete spam comments from your WordPress website.

Use Pre-loaded Option

Being the leading platform in the world on the internet, WordPress offers a solution to delete multiple comments from your website or blog in just one click. All you need to do is to visit the Comments section of your WordPress website and click on the “Empty Spam” options presented on the options panel. You can use the same method for cleaning pending, approved and trash comments too by going to the respective option.

WordPress Pre-loaded Option

Although it is an easy way to delete spam comments from a website, it is rarely used by people whose website receives thousands of spam comments every day. The major reason for this is a time-consuming procedure. In other words, this method takes a lot of time to delete comments in bulk. Many times, the website fails to delete comments and comes up with a message box saying that the requested URL’s length exceeds the capacity of your server.

Although it is an easy way to delete spam comments from a website, it is rarely used by people whose website receives thousands of spam comments every day. The major reason for this is a time-consuming procedure. In other words, this method takes a lot of time to delete comments in bulk. Many times, the website fails to delete comments and comes up with a message box saying that the requested URL’s length exceeds the capacity of your server.

Use phpMyAdmin

Webmasters always discover a way to execute any task they want in the world of desktop and internet. When it comes to the deletion of spam comments on a WordPress website, there are some ways that facilitate quick deletion, one of which is the utilization of phpMyAdmin.

This method involves a certain kind of coding to delete every type of comment such as spam, approved, pending and trash comments from the website. Whatever the category of the comment is, the process and efficiency to delete the comments are somewhat similar. This method of deleting comments is possible through the phpMyAdmin.

Delete Bulk Spam Comments

To delete the spam comments in WordPress using phpMyAdmin, you need to login to the cPanel of your website or blog and move to the phpMyAdmin in the database. Here, select the wp_comments table, and you can find a section consisting of all the comments. You can delete all the comments by marking every comment and clicking the Delete button. It should be noted that you should use the default prefix, i.e. “wp_” for effective deletion of these comments. If you want to delete only the spam comments in bulk, please enter the following code in the SQL tab and click GO.

DELETE from wp_comments WHERE comment_approved = ‘spam’

Delete Comments using phpMyAdmin

Use Plugin

One of the best features that every website running on WordPress is that webmasters can enjoy the option to install plugins to better and easier handle the site operation. With thousands of plugins available for several purposes in WordPress, there are several plugins that facilitate deletion of spam comments. Some examples are Batch Comment Spam Deletion plugin and WPCommentCleaner. You can use one of these spam deletion plugins to get rid of thousands of spam comments within a few seconds.

Now, what do you need to do for activating this plugin? In fact, you only need to install it on the website and customize it through the admin panel. These plugins are quite advanced and have the ability to delete thousands of spam comments within seconds. You can also use these plugins to delete pending as well as approved comments. It is most suitable for websites that receive a huge amount of spam comments as these comments can be deleted in just one click.

Deleting Comments using Plugin


Susan Rose is a freelance writer who has a deep knowledge about WordPress. She loves everything related to website building since the freshman year at Christopher Newport University, and loves to share her experience with people all over all the world. This girl is popular among our readers as she is outgoing and energetic. In the daily life, Susan loves detective novels as it can train her logical thinking and creativity.


Want to Learn More About WordPress?

Get Our Free Themes, Plugins, Support, SEO Tips, and Other Tutorials!

Email *