Categories: WordPress Tutorials

How to Remove the Website Field From the Comment Form

Last month, I made a lot of small improvements here at WP Kube and one of them was removing website field from the comment form.

Ever since I started the blog, I was getting a bunch of spam comments (and most of those were human spammers who were just commenting for backlinks).

I tried Livefyre & Disqus but didn’t liked it.

I always loved the default commenting system and there’s no way I could use another commenting system. So I decided to enhance the functionality of default WordPress commenting system.

By default the WordPress comment form has the website field and there is no simple way to disable it.

To remove the website field from the comment form, paste the below code into your functions.php file.

function remove_comment_fields($fields) {
    unset($fields['url']);
    return $fields;
}
add_filter('comment_form_default_fields','remove_comment_fields');

For Genesis Users

If you’re using Genesis theme then paste the below code in your functions.php file (the functions.php file can be found in your child theme)

add_filter( 'genesis_comment_form_args', 'url_filtered' );
add_filter( 'comment_form_default_fields', 'url_filtered' );
function url_filtered( $fields ) {

if ( isset( $fields['url'] ) )
unset( $fields['url'] );

if ( isset( $fields['fields']['url'] ) )
unset( $fields['fields']['url'] );

return $fields;
}

For Thesis Users

Thesis has built their own commenting system, so the best way to remove the field would be editing the thesis core files or using a css to hide the website field.

To hide the website field with css, please paste the below code in your custom.css file

.custom #commentform input[name="url"],  .custom #commentform label[for="url"] { display:none; }

That’s it. I hope that this tutorial has helped you in removing the website field from the comment form.

Devesh Sharma

Devesh is the founder of WPKube. He has been building and managing WordPress websites for 8+ years and has been featured in Forbes, HuffPo, Entrepreneur, and more! Follow him on Twitter.

View Comments

  • Hi Devesh, Have you found that this has been an effective way of getting rid of spammers? This change would be good for those who just want links back to their sites. Could you just make your blog a no-follow blog instead?

    Also, this would prevent CommentLuv from being used which is a great way of encouraging commenters. I'm wondering if you have found that you have fewer commenters as well as fewer spammers.

    Thanks for sharing this!

    • Hey Carolyn,

      I know this is not the most effective way of getting rid of spammers, but I think it depends on what type of site you're running. I can make this blog a no-follow instead but that won't stop spammers to leaving comments.

      I still get a lot of spam comments but far less then what I was getting a few months ago.

      Yeah, I do know this blog gets fewer commenters as well as fewer spammers but I am not really after comments. I think having fewer quality comments is much better then having 10+ low quality comments (that are there just for backlinks & traffic).

      Thanks for sharing your insights, Carolyn. I appreciate your great support.

  • Hi Dev,

    Great insights (I read even the comments too).

    But how would you find someone who makes thoughtful comments on your blog?

    • Maybe he can track them via the email address. But that would be a helluva lot of extra work to get a conversation on a topic.

  • I have the need to remove all three fields. and leave only the big field (field description).
    is it possible?

      • /** dcdcdcdcdcdc Rimuovere la funzione Info messaggio */
        add_filter( 'genesis_comment_form_args', 'url_filtered' );
        add_filter( 'comment_form_default_fields', 'url_filtered' );
        function url_filtered( $fields ) {

        if ( isset( $fields['url'] ) )
        unset( $fields['url'] );

        if ( isset( $fields['fields']['url'] ) )
        unset( $fields['fields']['url'] );

        return $fields;
        }

        /** dcdcdcdc Rimuovere la funzione Info messaggio */
        add_filter( 'genesis_comment_form_args', 'email_filtered' );
        add_filter( 'comment_form_default_fields', 'email_filtered' );
        function email_filtered( $fields ) {

        if ( isset( $fields['email'] ) )
        unset( $fields['email'] );

        if ( isset( $fields['fields']['email'] ) )
        unset( $fields['fields']['email'] );

        return $fields;
        }

        /** dcdc Rimuovere la funzione Info messaggio */
        add_filter( 'genesis_comment_form_args', 'name_filtered' );
        add_filter( 'comment_form_default_fields', 'name_filtered' );
        function name_filtered( $fields ) {

        if ( isset( $fields['name'] ) )
        unset( $fields['name'] );

        if ( isset( $fields['fields']['name'] ) )
        unset( $fields['fields']['name'] );

        return $fields;
        }

        • I tried this code to remove the 'email' option from the comments form:

          /** dcdcdcdc Rimuovere la funzione Info messaggio */
          add_filter( ‘genesis_comment_form_args’, ‘email_filtered’ );
          add_filter( ‘comment_form_default_fields’, ‘email_filtered’ );
          function email_filtered( $fields ) {

          if ( isset( $fields['email'] ) )
          unset( $fields['email'] );

          if ( isset( $fields['fields']['email'] ) )
          unset( $fields['fields']['email'] );

          return $fields;
          }

          But it did nothing. Any other suggestions?

          • Hi Dave,

            I just visited your site and it looks like you were able to remove the website field.

          • Hi Devesh,

            Yeah, it did remove the website field. Thanks for the post. I know it is off topic, but some also asked for the removal of: [website] option in the comments. And I was hoping someone had the code for that too for Genesis.

            thnx for the blogpost

            (btw: your website speed is very slow)

          • Hi Dave,

            I'll look into it and see if I can get something for removing the email id.

            Regarding the speed, is it still loading slow?

  • I'm using the Generate child theme in Genesis and this worked fine for me. The code snippets provided by StudioPress didn't work - so thanks a bunch for posting this!

  • Amazing resource, thank you for spending your time and effort in putting this list. I will be happy to share this post..

  • Thank you so much. I added your code to the end of functions.php just as you instructed and it work beautifully!

  • Is it possible to selectively remove a comment field (say a custom field) 'only' from the comment-reply form?
    for example my main comment form has a website/location field, but I don't want to ask people who reply to an existing thread to have to fill in that extra information.

Recent Posts

10 Best WordPress Website Maintenance and Support Services in 2024

Searching for the best WordPress maintenance service to get a little helping hand with your…

3 months ago

8 Best Managed WordPress Hosting Providers for 2024 Compared

Do you really need managed WordPress hosting? Let's face it: Running a WordPress blog or…

4 months ago

WP Engine Review (2024): Does It Really Make Your Site Faster?

WP Engine is one of the very first companies to start offering tailor-made hosting for…

4 months ago

Cloudways Review (2024): Is This a Good Alternative to Cloud Hosting?

Cloudways is a very original type of a web hosting company when compared to other…

4 months ago

7 Best WordPress Migration Plugins Reviewed and Compared for 2024

WordPress is incredibly easy to install, but if you want to move an already setup…

4 months ago

Divi Theme Review for WordPress: Should You Use It? (2024)

Considering using the Divi theme for your WordPress site? In our hands-on Divi theme review,…

4 months ago