How To Remove Website URL Field From WordPress Comment Form

Blog Comments are a great way to engage with readers. But, no wonder, spam comments are one of the most offending aspects of the blogger’s life. Problem right? Learn how to remove website URL field from WordPress comment form.

Seldom people like to comment on blogs, just for the sake of sharing their link through the blog post comment form. Backlinks are good only when created with the right intention and strategically.

What makes Webmasters to Submit a Spam Comment?

As you might have already received a lot of comments with weird keywords. It could be anything like, “Social Media Plugins, and “Best WordPress Courses” and “best WordPress plugins” and “Car Insurance” and “Make Money Online” and “Bridal Makeup artists” in the name field.

Although most of the spam comments are done through the bots only, But, few comments are completely irrelevant and done manually as well. Few examples

Spam comments

What do you think? Why do they do so? I know you already got the idea.

The answer is SEO(Search Engine Optimization). Let’s break this down and understand even closely.

Default WordPress comment form plugin comes with four fields, and it’s common for every WordPress blog.

  • Your Name
  • Email Address
  • Website URL and
  • Comment section

Such comment backlinks are generally no-follow. But, certainly, help in many ways in SEO and driving traffic. Of course only if done right.

So we have the answer now, so how to stop these spam comments and save a lot of time moderating it. There are several ways, we will talk about one in this article, removing the WordPress URL field.

How To Remove URL Field From WordPress Comment Form

If you know a bit of coding knowledge, you will understand that it can be done by removing the URL code in functions.php or comments.php. Although I never recommend editing the parent theme.

Any edits should be done only in the child theme, not to face the consequences of website crash or probably WordPress theme update issue.

In this blog post, we will take the help of Code snippet plugin, which can be used for any of your other future theme edits too.

  • Search for Code Snippet plugin from the plugin area. Install and Activate it.
  • Navigate Snippets >> Add New from your WordPress Dashboard. An input box will be visible.
Code Snippets Remove Website Field
  • Give an appropriate name and paste the below code in the box.
  • Finally, click on the Activate button to see the code in action.
add_action( 'after_setup_theme', 'tu_add_comment_url_filter' );
 function tu_add_comment_url_filter() {
     add_filter( 'comment_form_default_fields', 'tu_disable_comment_url', 20 );
 }

function tu_disable_comment_url($fields) {
     unset($fields['url']);
     return $fields;
 }

There you go, it would not take any time to remove the website URL field from the comment box. Check the below screenshot.

Comment Box Without Website URL Field

I have tested this code on a few of the popular WordPress themes and works well in all. This particular tutorial is created on one of my favorite themes GeneratePress.

No questions, why is this my favorite. The whole world knows. why it can be anyone’s favorite 🙂


Final Words On Removing URL Field in WordPress

We are fortunate enough that there are some anti-spam plugins that prevent your blog from such automated and spam comments. Antispam is one of them, which I like.

But, even those have some limitations and can not block all the spam comments.

Moreover, some comments are done manually, which looks spammy too. As there would be some keyword stuffed in the name field and comment is not relevant to the blog post at all.

In certain scenario, this trick of removing website field from the comment form would work great.

What are your thoughts on the same?

Relevant ReadHow to Add Lazy Load Comments in WordPress

One comment

Leave a Reply

Your email address will not be published. Required fields are marked *