WordPress allows commenting by default on the blog post or pages you create using WordPress. The comment area constitutes of the Name, Email, URL and Comment. Name and Email fields are mandatory but URL field is options. However, many automated bots try to exploit this feature and post some automated comments. This in result may not be good for the blog’s SEO and hence it should be avoided or stopped.
One way is to manually moderate all comments and spam the unsolicited comments, which apparently is a tedious job. The simpler way is to simply remove the URL field which won’t allow user’s to post the URL along with their comment. We are going to discuss how you can achieve this by simply adding a function in your WordPress theme file.
All you have to do is just open the file functions.php located in the themes folder and add the following piece of code at the end of the file.
function disable_comment_url($fields) { //print_r($fields); //uncomment this to see the default value of $fields unset($fields['url']); return $fields; } add_filter('comment_form_default_fields','disable_comment_url');
We are utilizing the filter comment_form_default_fields to change the default fields added by the function comment_form(). You can see the default content of the $fields array by using the print_r function. In the above code we have just unset the array key url and returned the array. In short we have applied a filter just before the comment form is outputted to the user. It’s worth noting that some bots may even post URLs even if you have this filter right in place, but that’s a rare chance. Good side is you are protected from manual blog commenting spam.
A neat trick to do an awesome job in WordPress. Hope that helps.
Stay Digified!!
Sachin Khosla


Is there a plugin?
Not sure, but there must be one. I have already written plugin for this, will publish sooner. Hang on there !
And we have a plugin here – http://wordpress.org/extend/plugins/disable-hide-comment-url/
Enjoy !
Simply Awesome. I can not tell you for how long i have been changing the Comments PHP in my themes to fix this.
Thank you so much
You can try the plugin as well http://wordpress.org/extend/plugins/disable-hide-comment-url/
The plug in does nothing for me. I installed it – there are no settings that I can see – and the URL field is still there for comments.
Hello John,
The reason could be that your template file is rendering the comment form using HTML and not via WP function like comment_form();
You can change the HTML structure in comments.php file and then call the above function. If the plugin is activated, it will remove the URL automatically.