Remove Website URL Field from WordPress Comment Form

Aug 18, 2020 | Wordpress

Making your website easy to use is important, so I like to remove unnecessary fields from forms – that way, it’s easier for people to get in touch with you. One of those annoying fields is the “Website URL” field in the WordPress Comment form. It is also often used for spam – by leaving their website, people are creating a link back to their own site. Removing this field will get rid of the incentive for people to leave you spam comments.

To remove this field from your comment forms, simply add the following to your functions.php file.

// REMOVE WEBSITE URL FIELD FROM COMMENT FORM
add_filter('comment_form_default_fields', 'joy_unset_url_field');
function joy_unset_url_field($fields){
    if(isset($fields['url']))
       unset($fields['url']);
       return $fields;
}

Did you find this helpful? Do you have any questions? We’d love to hear from you – leave a comment below!

Browse More Hints & Tips

8 Must-Do Things When Launching a New Website

8 Must-Do Things When Launching a New Website

So you're ready to launch your new website? That's awesome! When launching your website, there's a lot of things you MUST do in order to give your website the best chance of success. Some of these things will help your SEO, others will help you manage your website....

0 Comments

Submit a Comment

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