Remove URL Field from WordPress Comment Form

fake comments are coming for backlink on post, this is very common problem in blog or website. In this article we will learn how to remove website url fields from comment form .Wordpress providing plugin as well to remove url link from comment box, but we will use wordpress hook to remove website url option from comment box. I have read from wordpress blog and sharing with you guys.

Option 1:

Step 1- we will create below function in theme functions.php file.

Select Code
1
2
3
4
function remove_extra_comment_fields($fields) {
    unset($fields['url']);
    return $fields;
}

You can also add/remove form option here.

Step 2: Now we will call this fucntion on 'comment_form_default_fields' hook.

Select Code
1
add_filter('comment_form_default_fields', 'remove_comment_fields');

It will error generate if you will update theme.

Option 2:

Use wordpress plugin to remove website url.
You can use this plugin Hide-n-Disable-comment-url-field

Option 3:

Remove URL input from comment.php file or comment below code.

Select Code
1
2
3
4
5
'url' =>
    '<p class="comment-form-url"><label for="url">' . __( 'Website', 'phpflow' ) . '</label>' .
    '<input id="url" name="url" type="text" value="' . esc_attr( $commenter['comment_author_url'] ) .
    '" size="30" /></p>',
);

This will generate error if you will update word press.

I hope it will help you.

  • DustinAllcot

    Wohh exactly what I was searching for, regards for posting.

  • BennettBello9

    I do not know if it’s just me or if perhaps everyone else experiencing issues with your blog. It appears as though some of the written text in your content are running off the screen. Can somebody else please provide feedback and let me know if this is happening to them as well? This may be a issue with my internet browser because I’ve had this happen previously. Thanks

    • yup,
      actually i am fixing issue that’s why some dummy text appear on header.

  • JorgHolmes057

    I genuinely prize your work, Great post.