Removing Website or URL field from Comment Form in WordPress

Removing Website or URL field from Comment Form in WordPress

 

If you want to remove the website or URL field from the comment form. This is sometime required because some of these comments will be spam and it just want link to their website. These are the steps you can do to remove it.

With Website input box

image

 

Without Website Input box.l

image

 

Step 1

Find out Editor option from the Appearance link. Here you find out the file comments.php .

image

 

Comment out following line

<input type=”text” name=”url” id=”url” value=”<?php echo $comment_author_url; ?>” size=”22″ tabindex=”3″ />
<label for=”url”><small>Website</small></label>

image

 

Step 2

Add following line into functions.php.

 

function crunchify_disable_comment_url($fields) {

unset($fields[‘url’]);

return $fields;

}

add_filter(‘comment_form_default_fields’,’crunchify_disable_comment_url’);

 

Step 3

Install following plugin, it will automatically comment out the website related code.

https://wordpress.org/plugins/remove-comment-websiteurl-box/

Leave a Reply

%d bloggers like this: