Tuesday, August 28, 2012

How to remove the url field from WordPress comment form

In some cases, you may not need or want that people who comment your posts can leave their website url. Here is a simple code snippet to remove the url field from WordPress comment form.

Paste the code below into your functions.php file. Once saved, the url field will be removed from your comment form.
 
function remove_comment_fields($fields) {  
    unset($fields['url']); 
     return $fields;  
}
  add_filter('comment_form_default_fields','remove_comment_fields');

No comments:

Post a Comment