Disclosure: ULTIDA's content is free & reader-supported. We may earn a commission if you click & buy through our links. Your support helps us create the best content & make a difference.

How To Stop Spam Comments In WordPress (8 Ways)

how to stop spam comments in wordpress

Do you want to learn how to stop spam comments in WordPress?

A few days ago I showed you how to disable comments in WordPress.

And while that will prevent spam comments, too, it’s not the solution we are going for today.

In this tutorial, you will find out how to EFFECTIVELY stop the spammy comments that are flooding your website.

This will ensure your website is not blacklisted by Google and save you a ton of time as you won’t have to deal with spam anymore.

This post covers:

What Is Comment Spam

It’s a term that references a broad category of comments which are usually automated with the intention of advertising different (usually shady) content from casinos, forex, crypto, and other similar topics.

The bots mainly target blog posts, guestbooks, comment forms, and other vulnerable parts of your website.

Why You Should Remove Spam Comments

A better question is, why wouldn’t you remove spam comments?

The main goal of spammers is to get a do-follow or no-follow link from your website.

And that is NOT good for SEO. Or anything else, for that matter.

There is absolutely nothing positive about spam, and it doesn’t seem it’s going away anytime soon.

Spammers and scammers are always trying to take advantage of unsuspected users, and if you are not careful, you can do A LOT OF damage to both your website and your visitors.

You really don’t want your readers to be clicking on suspicious links.

In the worst-case scenario, they might end up with malware like ransomware, spyware, or adware on their computers which can cause serious damage.

What’s in it for the spammers then?

These spammy links aren’t even good for spammers’ websites in the long-term, but they can benefit from some short-term traffic boosts (and quick money), which, trust me, won’t last long.

But it’s SO NOT worth it!

8 Ways To Stop WordPress Spam Comments

Now let’s start our spam cleansing mission.

I will explain in detail the best ways to prevent those pesky spammy comments from ever appearing on your WordPress website.

1. Disable Comments Entirely

The most drastic measure that you can take is to disable and remove all your website comments.

That will definitely keep the spam away.

Disabling comments globally is very easy to do.

Go to Settings > Discussion and uncheck the “Allow people to post comments on new articles” option on the right.

how to disable all comments wordpress

Save changes.

Users cannot post new comments anywhere on your website anymore.

That is especially useful if you are just starting with your website, as the option above ONLY prevents new comments.

If you already have a lot of spam comments, then you will have to delete them manually or with a plugin (we’ll go into details later).

Disable comments with a plugin

If you prefer using a plugin to disable comments, I suggest you pick Disable Comments.

It allows you to globally disable and delete comments on your website. They can be disabled based on the post type which can be really useful.

Install & activate the WP plugin and head to Settings > Disable Comments.

disable comments with a wordpress plugin to prevent spam

Now simply choose whether to disable the comments on all your content or only on specific post types.

But what if you want to have comments on your website as you would like to have a thriving community exchanging opinions about your content or products?

That’s when the next steps come into play.

2. Enable Comment Moderation

This is a good option if you don’t have a lot of comments.

Moderation allows you to manually check every comment before it goes live.

enable comment moderation in wordpress to prevent spam

This means you have full control over everything that your visitors or bots try to publish via the comment section.

To enable comment moderation, head to Settings > Discussion and check the box that says, “Comment must be manually approved.”

You can tighten the measures even further by allowing commenting only to authors who have a previously approved comment.

3. Turn Off Anonymous Comments

How do you make sure that only real people and not bots are commenting on your website?

turn off anonymous comments

The easiest way is to go to Settings > Discussions and then check the “Comment author must fill out name and email.”

But you can also take things to the next level by Implementing OTP verification (Phone/Email verification by sending an OTP code). It will do a good job of removing the anonymity of your visitors, but it comes with a hefty price.

However, I only recommend it when more is at stake (for example, at the login screen for all your financial matters) because it doesn’t make much sense to limit overall comments like that.

Hey, I’m just sharing what’s possible regarding fighting SPAM.

4. Restrict Comments Only To Registered Users

Another way is to allow only registered users to comment on your website or blog.

restrict comments only to registered users

Visitors can either register an account on your website or log in with their social networks.

The latter has been very popular lately, so most of your readers will be familiar with this option.

And that’s why this is a much better option than OTP authentication. It’s a lot faster to implement and WAY cheaper.

limit comment links to prevent spam in wordpress
The main problem with spam comments is the abundance of links they contain.

Is there a way to limit or even prevent links in comments altogether?

The beginner way

The quick way of limiting comment links is to go to Settings > Discussion and then configure Comment Moderation.

The advanced way

We can use filters in WordPress to prevent comment links.

To achieve that, insert the following code into your theme’s functions.php.

remove_filter(‘comment_text’, ‘make_clickable’, 9);

This hook will prevent WordPress from automatically creating links out of plain URLs in your comments section.

If you are not familiar with code editing, I suggest using the Comment Link Remove and Other Comment Tools plugin.

It’s a great all-in-one solution to keep spam away from your blog and thus significantly improve the quality of your comment section.

After you install the plugin, click on the QC CLR Settings button in the left sidebar of your WordPress admin panel.

remove links from comments with a plugin

As you can see this plugin enables you to prevent spam in comments for most of the situations that we discussed so far.

You can even delete the existing comments, so there is no need to install another plugin for that task.

And the PRO version offers refined tuning for each of the settings like auto-moderation, comments filtering, minimum comments length, enabling/disabling emoticons in the comments, etc.

6. Create Disallowed Comment Keys (“Blacklist”)

Another interesting method available from your WordPress dashboard is the disallowed comment keys list.

Head to Settings > Discussion and scroll to the bottom where you will see the Disallowed Comment Keys text field.

disallowed comment keys list in wordpress

You simply add certain keywords (one word or IP address per line) to the list.

When a comment contains any of these words in its content, author name, URL, email, or IP address, it will be automatically moved to the trash.

It will take some time to set it up, but it can be quite effective. The only downturn is that you will have to update it frequently.

7. Stop WordPress Spam Comments With A Plugin

There are numerous plugins out there that can help you fight spam. We will review two of the most popular ones.

Akismet WordPress plugin

akismet plugin to prevent comment spam
If all of the solutions described above are either too complicated or are not doing enough to prevent spam, then it’s time to install the best anti-spam plugin for WordPress, Akismet.

It checks your pending comments and forms submissions against its global database to prevent spam comments from publishing.

You can then check pending comments just to see if any of them are valid and publish them.

The best part is that the personal license for your blog is completely free, and it’s up to you to pay what you can afford if the plugin meets your needs.

All you have to do is sign up for one of their plans and then use your API key to activate the Akismet plugin.

And that’s it, you are now protected from all the spam and malware found on the internet.

After years and years of working with Akismet, it never disappointed me nor my clients.

Google reCAPTCHA

google recaptcha to prevent wp comment spam
It’s a well-known verification solution that protects your website forms from spam entries and only allows real users to post via your contact and comment forms.

I recommend the Simple Google reCAPTCHA plugin.

You can also use it on your login page, registration forms, password recovery, and more.

Users need to solve a simple puzzle that is almost impossible for bots to complete but should be a fairly easy task for most users.

The downside is that some users can find it annoying and might decide to just leave your website and never write that precious comment.

Yup, can happen.

8. Use A 3rd-Party Commenting System

The last solution that we will discuss in this tutorial is the Disqus commenting system.

This is probably today’s most popular 3rd-party commenting system on the internet, and rightly so.

It is a complete solution that allows website owners to add a system that provides meaningful discussions, efficient moderation, and engaged communities.

Similar to Akismet, you start by signing up on their website.

You can sign up for the free version of the plugin, which displays ads in the comment section.

The cheapest ad-free plan will cost you $11 per month and that will cover you for up to 50,000 daily pageviews.

If you have a website with 5,000+ daily views, then $11 is a bargain for what you get in return.

Disqus has a lot of features to grow your audience and engage with them in the best possible way:

  • Analytics will help you track and understand your audience’s behavior and further increase engagement.
  • Monetize engagement with meaningful integrations of ads from the best partners.
  • Retain your readers with cross-site and email notifications to bring commenters back to your site.


I’m sure you now have the best solution to fight against spam.

The manual solutions can work really well if you have a smaller site but for all the rest, I recommend picking a plugin.

Akismet is probably the best available solution at the moment and it’s no wonder that it’s by far the most popular anti-spam plugin for WordPress.

Fun fact: Automattic owns Akismet, which is the company behind WordPress, so it makes sense why it’s so huge.

But Comment Link Remove and Other Comment Tools plugin is also very decent.

And it’s free no matter how many page views you have. It’s very simple, yet effective. Sometimes, that’s all you need.

Manual solutions are only for users who want full control over their comments and have some technical knowledge to set everything properly.

Keep in mind that this demands continuous time investment on your part because you will have to moderate comments daily and frequently update the blacklist.

FAQs About Stopping Spam Comments In WordPress

How can I automatically filter spam comments on my WordPress site?

Use plugins like Akismet to filter out spam comments automatically. Akismet checks comments against a global spam database to prevent them from appearing on your site.

Can I manually approve comments before publishing?

Yes, WordPress allows you to approve comments manually. Go to Settings > Discussion and check the option “Comment must be manually approved.”

Can I block comments containing specific words?

Yes, WordPress has a built-in feature to block comments containing specific words. Go to Settings > Discussion in your dashboard, and add the words you want to block in the “Disallowed Comment Keys” section.

How can I limit comment spam from certain countries or IP addresses?

Use plugins like Wordfence or IP Geo Block. These allow you to restrict access or comments from specific countries or IP addresses.

Is there a way to disable comments on older posts automatically?

Yes, WordPress allows you to automatically close comments on articles older than a certain number of days. This option is under Settings > Discussion, where you can set the number of days.

Can adding a CAPTCHA help reduce spam comments?

Yes, adding a CAPTCHA can significantly reduce spam comments. Plugins like reCAPTCHA or WPBruiser can integrate CAPTCHAs into your comment form, making it harder for automated bots to submit spam comments.


Note: This article was originally published on October 7, 2022. But our team regularly reviews it and updates it with necessary improvements for accuracy.

About Author

Ales has been in love with computers ever since he got Amiga 500 almost 30 years ago. He earned his bachelor’s degree in Computer science from Ljubljana University, Slovenia. In 2010 he co-founded PremiumCoding, a website that makes awesome WordPress themes that are also for sale on ThemeForest. In the past few years, he focused mainly on combining web design, code and photography into a seamless experience.