How to stop spam comments on your blog or website without plugins

If your website or blog suffers from spam comments, they can adversely affect your SEO and Google search ranking, and it can put off visitors. No-one likes spam, so let’s see how to stop it.

Good comments and intelligent conversation from enthusiastic visitors to your blog or website enhances posts and makes them more valuable to visitors. The comments enable you to address concerns readers may have about the article, product or service, they enable you to clear up confusion, fill in missing details, and more.

An active discussion can bring people back to your site because they may check for replies to their comments. They can also keep people on your site longer because there is more to read and more to interactive with.

In short comments are great! Except when they aren’t. Bad comments can adversely affect your Google search ranking and they can put off visitors.

There may be legal problems with what is said in comments and that could put you and your site in an awkward situation. Links may be posted to gambling and other adult sites, fake phishing sites, get rich quick schemes and s o on.

This means that so comments must be moderated and bad ones deleted. It takes time and effort that might be best used on other tasks.

What can you do if comments are negative, spammy and full of junk?

There are anti-spam plugins of course, but whether you need one depends on how much of a spam problem you have. WordPress has built in features for blocking bad comments, so before adding yet another plugin to your site, try these settings.

Block all comments

Some big websites have become so frustrated by spammers, marketers, trolls and others posting junk at the foot of every post that they have disabled comments completely.

Completely blocking comments does not mean that readers cannot comment. You could engage them on Twitter, create a separate forum or use a Facebook group. That last option is a good choice and you can link to your group at the bottom of an article with a note to tell readers to discuss it there.

A facebook group has the advantage that it can pull in people who have not yet seen your site and you can turn them into regular visitors.

Disable comments in WordPress

In the WordPress admin interface, go to Settings > Discussion and near the top is an option to allow or block comments on new articles. Clear the checkbox to disable comments completely.

Make users log in

If you allow people to log in to WordPress, such as to access special content for members, you could limit comments to people that are logged in.

Most visitors to your site do not log in, so this prevents a lot of people from commenting. It can block a lot of good comments as well as bad ones and it seriously affects the engagement of readers, which can be a bad thing.

Restrict WordPress comments to users that are logged in

This is in the WordPress admin interface. Go to Settings > Discussion

Close comments on old articles

It is possible to prevent comments on articles older than a certain number of days. So you could allow comments for a week or a month, but then prevent any more being added. This at least cuts down on the amount of moderation you have to do because only recent articles will have new comments that you need to check.

Disable comments on old posts in WordPress

This can limit good comments as well as spam and not everyone reads articles as soon as they are posted. With evergreen content people could be reading articles in six months or even a year’s time. They will want to comment and will be blocked if this setting is used.

It is not the perfect solution, but it can stop the comment spam on old articles.

Withhold comments for moderation

There are a couple of useful options that enable you to check comments before they are posted. Tick the box Comment must be manually approved. If you visit your site every day, this could be a useful option. Comments appear in the Comments section of the Admin interface and you can quickly check each one and publish or delete them.

Manually approving comments is useful when you have only occasional comments. On a busy website or blog it would be too much work checking each one. Also, people like to see their comments appear on the page immediately rather than disappearing for hours until they are approved.

Comment moderation in WordPress

The second option here can help reduce the amount of work manually approving comments and if a commenter has previously had a comment approved, they are automatically approved for subsequent comments. Regular visitors to your site will therefore have no restrictions on posting comments, but a spammer who doesn’t get their comment approved will not get through.

Moderate comments with links

Spammers and marketers want to create backlinks to their websites to improve their search engine ranking and to get people to click links and visit their sites.

A common feature of spam comments is that they contain one or more links. If you withhold comments that contain links for moderation, (approve them in Admin > Comments), it means that genuine discussions can take place on your site and people can post unimpeded, but spammers posting links are are blocked.

This is in the WordPress admin interface. Go to Settings > Discussion

Withhold comments with links in WordPress

Sometimes people share good links, such as to articles, products or services elsewhere on the web and these will be withheld until you approve them too. However, most comments do not contain links so most people are unaffected by this setting.

Moderate comments with banned words

If you spot a pattern to the spammy and bad comments that are being posted, enter keywords and phrases into the the Comment Moderation box. You could type bad language such as swear words, typical phrases like ‘visit my site’, ‘gambling’, ‘casino’ and whatever else often appears in comments. Build your banned list.

Withhold comments that contain links in WordPress

Here you can see that I check for variations of links and whenever any of these items are found in a comment, it does not get published until I approve it. It picks up spammy links.

Comments containing words in your banned list are not published and can be seen in Admin > Comments where you can approve or delete them.

Block comments with banned words

This is exactly the same as the previous option, but instead of comments being withheld for moderation, they are simply sent straight to the trash immediately if they contain the words in the banned list.

I tried comment moderation, but it was all spam, so I moved the list of banned words over to Comment Blacklist. It just sends all comments with these in to the Trash.

Blocked words in WordPress comments

Notice that they are all links. Spammers love links and so spam comments are easily caught. You can also use this in combination with the Content Moderation list. See what comments are caught and if there are some that you always delete, add them words to the Comment Blacklist.

Hide the comment form URL

The comment form in WordPress has boxes for people to enter their name, email and website URL. A URL box is a wonderful thing for spammers because it enables them to create a backlink to their website to sell or promote their junk.

You should hide the URL box because it serves no useful purpose and only encourages spam.

Go to WordPress Admin > Appearance > Edit CSS and enter this line:

.comment-form-url {display:none;}

Hide the comment URL box in WordPress

If you check the comment form at the bottom of this page, there is no box to enter the URL and there is just the name and email.

It is impossible for a person to enter a URL in a comment form because it is invisible. However, bots (automated programs that visit websites and post spam), can still see it and still fill it in.

Go to Admin > Comments and if you see a comment that contains a website URL in the Author column, you know it was posted by a bot and not a real person. It’s spam.

It won’t get posted because the settings for withholding comments with URLs catches it.

Delete spam comments

All these settings are designed to catch spam and prevent it from appearing on the posts on your site, but how do you actually deal with it?

  • If you have a Comment Moderation list to catch spam, it ends up as a Pending comment.
  • If you have a Comment Blacklist to catch spam, it ends up as a Trash comment.

Whenever you have a spare minute or two, go to Admin > Comments and click the Pending link at the top. You may want to quickly scan through the comments just in case a real one has been blocked in error.

Delete pending WordPress comments using bulk actions

Mostly you just need to select all the comments with the checkbox at the top, click Bulk Actions, select Move to Trash, and click Apply.

I just use a Comment Blacklist to everything is in the Trash anyway. Just select it, quickly scan the junk for anything that should not be there and them empty the trash with the button.

Manually dealing with spam this way is fine for small numbers of spam comments if you regularly visit your website. It is not useful if you get 100+ spam comments a day and only visit your site once a week. Huge spam problems are best dealt with by a plugin.