How to remove website (URL) field from WordPress comments?

WordPress bloggers who loves content sharing and engaging their followers uses comment section to express opinions of other fellow bloggers and readers. But that comment section is also the most spammed section in the WordPress, as you know there are end numbers of annoying scrappers, auto comment bots, and similar tools that spam the WordPress’s comment section for free back links.

The only way to limit such kind of spam comments to either install an anti spam plugin which is not user friendly (annoying for authentic users) or removing the website field all together like below one.

WordPress comment section

I know the second one is way more useful if you really want to get rid of those spam comments. In this article we’ll see how to remove website (URL) field from WordPress comments.

Add the following code in the theme’s function.php file and save it:

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

Make sure you backup the site before adding the above code.

To see the immediate effect remove the cache (if any) and load your website in view some recent articles. You’ll notice that the website field is gone from the comment section.

Published by AtulHost

Creator of AtulHost. An ardent Linux user. Comes from a business management background. Loves to do research on modern business insights and enterprise solutions like career, education, finance, investments ideas, marketing strategies, and productivity skills; technological trends like automation, artificial intelligence, cloud and edge computing, computer hardware and networking, data science, and the internet of things.

Join the discussion

Required fields are asterisked and email address will not be shared.

Ensure a friendly atmosphere to our members and visitors. Encourage the freedom of expression and exchange of information. Comments that are off-topic will be deleted.