Remove The Website Field From The WP Comment Form

How to remove the website field in the Wordpress comments section by adding a filter within your functions.php file.

How To Remove The Website Field From The WordPress Comment Form

Back in the good ol’ days it was cool to have the “website” field in your WordPress comment form. Although it’s not a required field, this is a sure fire recipe for spam not to mention is just one more thing a user must think about filling out to engage with your content. So, these days as WordPress is used more on everyday websites rather than niche specific blogs – it’s a wise move to go ahead and remove the website form field from the comments section.


Removing The Website Form Field From A WordPress Comment Form Using (functions.php)

Alright, so what we are going to do here is simply add a filter and place it at the bottom of your functions.php file. This file can be found in your main WordPress template directory. Here is the code:

add_filter('comment_form_default_fields', 'website_remove');
function website_remove($fields)
{
if(isset($fields['url']))
unset($fields['url']);
return $fields;
}

That’s it! The website field in your comments section will now be history. On another note, there are quite a few plugins that do this for you as well such as this one but, who needs another plugin…

Was this helpful? Do you have a better method? We want to hear your thoughts and feedback, chime in below in the comments.

Back to Blog

Leave a Reply

Your email address will not be published. Required fields are marked *