How to Remove URL / Website Field from WordPress Comment Form?

Join InfoPhilic Community!

Let's build a community to help & encourage each other to grow!

Engagement is extremely important for any website. In order to set up proper engagement, a direct line of communication should be fostered with care. One way for it is comment form.

WordPress comes with a built-in comment system that allows for community interaction around your content. Anyone with a valid Name and Email can leave a comment without verifying their identity.

WordPress comment form comes with three fields (name, email, and website or URL). When displaying the comments, WordPress automatically hyperlinks the name of the commenter with the website URL they provided.

It is true that WordPress websites attract a lot of spammers as most of them know how easy it is to build backlinks off from them. Most bloggers do not know how to control spam and they do not have the time to moderate each comment.

Some blackhat SEO guys misuse it and spam your site. And you may be finding the ways to stop spam on your website. One of the ways includes removing the URL/Website field from comment form is always beneficial.

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.

In this guide, I will tell you two easy ways to remove the URL/website field from the WordPress website.

1. Using comment.php:

  • Go to your theme’s comments.php file.
  • Just remove ‘url’ => field from the code.

Here is the sample code that you have to remove:

$url = '<p class="comment-form-url">' .
'<input id="url" name="url" type="text" value="' . esc_attr( $commenter['comment_author_url'] ) . '" size="30" tabindex="3" />' .
'<label for="url">' . __( 'Website', 'genesis' ) . '</label>' .

Note: Every theme has different code. So make sure you are removing it accordingly. The above code snippet is from the Genesis framework.

2. Using Function.php:

Add below code to theme’s functions.php file.

// Remove URL/Website field in Comment form
function infophilic_remove_comment_url($fields) { 
return $fields;

The code above creates a function called website_remove() and removes (or unsets) 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.


I hope you find this article useful, and hopefully, this will decrease spam comments on your site. You might also want to read my another guide on ‘How to Remove Comment Author URL in WordPress‘.

How do you deal with manually submitted spam comments on your site? Share your opinions in the comment section below.

Subscribe to our newsletter

To be updated with all the latest news, offers and special announcements.

Comment Policy: Your words are your own, so be nice and helpful if you can. Please, only use your real name and limit the amount of links submitted in your comment. We accept clean XHTML in comments, but don't overdo it please.



Please enter your comment!
Please enter your name here


Start WordPress Blog: Ultimate Guide For Beginners

Here is our step by step guide for beginners to start a WordPress blog.

Top 6 Best WordPress Theme Frameworks

There are many websites themes which are created by using a framework. Likewise, WordPress Theme frameworks also becoming so popular. The framework allows you...

The Most Essential WordPress Plugins

Here, I have listed some excellent plugins which will surely add more features and new functionality to your WordPress blog.

Tips to Speed Up WordPress Performance

Here, I am sharing some tips to speed up WordPress performance. All you need to modify .htaccess file on your server and add some plugins.

The Ultimate Guide to Harden WordPress Security

Learn how to improve WordPress security. Here are some basic security concepts that will help you to harden WordPress security.

How to Setup CloudFlare Free SSL for WordPress Blog

Google has announced that they will count HTTPS as a ranking factor which means if you using HTTPS you will get a higher position...



MonsterInsights is the best Google Analytics plugin for WordPress. Setup Google Analytics for WordPress with just a few clicks.


Get almost 100% PageSpeed on Newspaper theme

The newspaper theme is the most popular premium theme for a self-hosted WordPress blog. The theme is developed by team tagDiv. You...

How to Remove jQuery Migrate in WordPress?

jQuery Migrate greatly simplifies the process of moving older jQuery code to a higher jQuery version by identifying deprecated features. It then restores deprecated...

How to configure WP-Rocket plugin for WordPress site

When it comes to optimizing your website, the role of caching in WordPress can never be underestimated. What exactly is caching all about?...

How to Delete Multiple Images in WordPress Media Gallery

Hey, guys today one of my friends asked me a question, How can I delete Multiple Images in WordPress? I replied, "It's very simple." Yeah,...

Xperia Home Launcher: Install on any Android Device (No Root)

Hey, guys today through this tutorial you are going to learn how to install Xperia Home Launcher on any Android device without any root. Also...

How to create News Sitemap for WordPress site?

Learn how to create special news sitemap for your WordPress blog/ website using Yoast News SEO plugin and Jetpack plugin.