The first reason for spam comments is getting backlinks. Spammers use bots to make comments on hundreds of blogs quickly.

They intend to put a link on the “Website Field” of the comment form. And this is why they try to make comments on your blog.

Clickable author link that came from website-field
Author link that comes from “Website Field”

So if you remove the “Website Field” from the comment form, it will discourage the spammers to comment on your posts because they will not get any backlinks from their comments.

Write the following code in your “functions.php” file to remove the “Website Field” from the comment form:

// remove website-field from comment form
add_filter('comment_form_default_fields', 'remove_website_field');
function remove_website_field($fields){
    if(isset($fields['url']))
       unset($fields['url']);
       return $fields;
}

However, this will not block the spammers by cent percent. It will discourage the spammers & bots to comment on your post because they will not get any benefits from their comments.

But some novice spammers may not care about it and they will still make spam comments. And you have to go through each comment and mark it as spam manually.

I introduced this method because some people don’t want to use plugins and like to write code instead.

But if you intend to block spam comments, see another post to learn more.

Spammers find your website before the web crawlers and search engines. No matter if you are a new or old blogger, the spammers always try to make comments on your posts to get backlinks. Even if it’s a “Hello World” demo post, they will make comments everywhere.