How to remove URL field from WordPress comment form

Victor Mochere
4 Min Read

Spam comments are a huge problem for many blogs. It’s true that WordPress websites attract a lot of spammers as most of them know how easy it is to build backlinks off from them. The more comments containing backlinks will cause your posts to have more outbound links and it will cause harm to your SEO efforts. Most bloggers do not know how to control spam and they do not have the time to moderate each comment. The perfect way to discourage spam is to remove the ‘Website’ or ‘URL’ field entirely from your WordPress website.

Why do people submit spam comments?

People submit spam comments to try and improve their SEO. They do this by adding their website URL. WordPress’s default comment form includes the following four fields: name, email, website URL, and the comment box. When displaying the comments, WordPress automatically hyperlinks the name of the commenter with the website URL they provided.

This backlink provides an incentive for blackhat SEO marketers and newbie bloggers. They believe this tactic can help them get better rankings for specific keywords in search engines and the more backlinks from reputable sites they get, the better their SEO score. This is a blackhat SEO trick and for the most part, it doesn’t work. However, every blog owner will tell you that they receive tens of spam comments every day nonetheless.

How to remove the website URL field from the WordPress comment form

Since majority of the spam is generated by automated bots, you can easily combat comment spam by using free tools and plugins. The trickier part is to discourage spam comments submitted manually by humans. These unwanted comments are submitted by actual users and are often off-topic, irrelevant, and add no value to the discussion. Here’s how to remove the website URL field from the WordPress comment form. There are two methods you can use to remove the website field from comments.

1. Plugins

There are many plugins available in the WordPress repository that removes the website URL field from blog comments. For many, this is an easy way out. However, some people may not want to use more plugins on their WordPress website.

2. Theme file editor

Before using this method, ensure that you maintain a complete documentation and backup of your WordPress website.

  1. Navigate to WP Admin > Appearance > Theme File Editor.
  2. Select functions.php.
  3. Insert the following code at the last line in the functions.php.
add_filter('comment_form_default_fields', 'unset_url_field');
function unset_url_field($fields){
       return $fields;

The code above creates a function called unset_url_field() unsets (or removes) the URL field. Using the hook add_filter(), we pass the argument to default WordPress function comment_form_default_fields that contain fields of the comment form.


If you are a constant target of comment link spam and you have very little time to moderate the comments, then removing the website field entirely will seriously discourage the link spammers. The URL field is not useful in most cases, as genuine commenters probably do not own a website and it simply allows spammers to build links to their websites.

Share This Article
Victor Mochere is a blogger, social media influencer, and netpreneur creating and marketing digital content.
Leave a comment