Removing Website field from Comments form

Posted in: Newspaper
Post count: 66

Hi guys,

I want to remove the Website field from the comments submission form because it’s a spam magnet. I did some digging around the WordPress forums, and some people suggest adding this to functions.php:

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

Would that work?

Post count: 388

Looks like it will (and tested on my site). You can remove the line with “email” because that will remove the email field as well.

Note that the functions.php you’d want to add this to would be in a child theme so the fix can survive theme updates.

Post count: 6600

Hi,

You could try to add that filter into your functions file or you could just remove this code from comments.php file like this: http://screencast.com/t/NsY1CbDxx

Thanks

  • This reply was modified 11 years by Lucian.
  • This reply was modified 11 years by Lucian.
Viewing 3 posts - 1 through 3 (of 3 total)
The forum ‘Newspaper’ is closed to new topics and replies.