How to Remove Website URL Field from WordPress Comment Form

How to Remove Website URL Field from WordPress Comment Form

Divi WordPress Theme

If you are a constant target of comment link spam and you have very little time to moderate the comments, then remove the website URL field from WordPress Comment form entirely will seriously discourage the link spammers.

Engagement is extremely important for any website. In order to set up proper engagement, a direct line of communication should be fostered with care. One way for it is comment form.

WordPress comes with a built-in comment system that allows for community interaction around your content. Anyone with a valid Name and Email can leave a comment without verifying their identity.

50 Free Responsive Web Design PSD Photoshop Templates

Download Now

Recommended Reading: 30 Free Responsive PSD Website Templates

WordPress comment form comes with three fields (name, email, and website or URL). When displaying the comments, WordPress automatically hyperlinks the name of the commenter with the website URL they provided.

It is true that WordPress websites attract a lot of spammers as most of them know how easy it is to build backlinks off from them. Most bloggers do not know how to control spam and they do not have the time to moderate each comment.

Some blackhat SEO guys misuse it and spam your site. And you may be finding ways to stop spam on your website. One of the ways includes removing the URL/Website field from comment form is always beneficial.

If you are a constant target of comment link spam and you have very little time to moderate the comments, then removing the website URL field entirely will seriously discourage the link spammers.

In this guide, I will show you the easiest ways to remove website URL field from the WordPress comment form.

Using Function.php

Add below code to your theme’s functions.php file to Remove Website URL Field from WordPress Comment Form.

// Remove URL/Website field in Comment form
add_filter('comment_form_default_fields','infophilic_remove_comment_url');
function infophilic_remove_comment_url($fields) {
    unset($fields['url']);
    return $fields;
}

The code above creates a function called website_remove() and removes (or unsets) the URL field.

Using the Hook add_filter(), we pass the argument to default WordPress function comment_form_default_fields that contain fields of the comment form.

Conclusion

I hope you find this article useful, and hopefully this will decrease spam comments from your WordPress website.

If you enjoyed this article, you can also read Easy Steps to Start a WordPress Blog and Make Money.

You might also want to read my another guide on ‘Best WordPress Cheat Sheets For Designers And Developers‘ and ‘18 Traffic Boosting Tips for Your WordPress Blog‘.

How do you deal with manually submitted spam comments on your site? Share your opinions in the comment section below.

Written by
Suresh Patel
Join the discussion

Subscribe To Our Blog For All The Latest & Greatest Freebies!

Following our blog is a great way to make sure that you are up to date on the latest and greatest Freebies and WordPress news.

We don't spam and your information will never be shared.