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

Autoplay Videos in Divi

Autoplay Videos in Divi

Setting videos to autoplay has bugged website developers for years, and in Divi there are no default options to Autoplay your videos. Some people suggest setting your video as a background to allow autoplay, but this comes with its own issues (like setting the...

How to Choose the Best Website Address (Domain/URL)

How to Choose the Best Website Address (Domain/URL)

This article was first written 24 Sept 2011, and has been updated August 2020. What is a website address? Your website address, or domain name, is used to identify and access your website. It looks something like www.yourwebsite.com. No two website addresses...

0 Comments

Submit a Comment

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