How to Remove the Website Field From the Comment Form

How to Remove the Website Field From the Comment FormLast 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.

About the Author: Devesh Sharma is a WordPress fanatic and loves experimenting with WordPress themes & plugins. Get more from Devesh on  and Twitter.

You May Also Like:

13 comments… add one
  1. Brad Dalton says:

    Excellent. Thanks Devesh!

  2. 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.

  3. Rahul Kuntala says:

    Hi Dev,

    Great insights (I read even the comments too).

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

    • tonygreene113 @ 113tidbits says:

      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.

  4. Thanks, Devesh. Worked like a charm on a Genesis Theme (Focus). Appreciate you sharing this very much.

  5. Cristiano says:

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

    • Cristiano says:

      …about Genesis Theme…

      • Cristiano says:

        /** 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;
        }

  6. 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!

  7. Gajendra Megajolla says:

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

Speak Your Mind...

A Weekly WordPress Newsletter...

Subscribe now and you will get -

»  Free Guide – Building a Successful WordPress Blog.
»  Weekly Newsletter curating useful blog posts and resources.
»  Exclusive Discount & Deals on Premium Products.

Your email will never be shared with anyone.