Remove the URL field in the WordPress comments form

As we know, comments are often misused by website visitors to get external links. Outgoing links are now automatically marked with the rel="nofollow" attribute. Nevertheless, many comments are based still on the intention to get an external link.

Such spam comments often have little meaning and can sometimes be very annoying. However, this can be easily solved by removing the URL field from the WordPress comment form.

How can I remove the comments URL field?

To remove the URL field from the comment form, we use the WordPress filter comment_form_default_fields. Just add the following code snippet, for example into the functions.php of your theme:

With the exception of spam comments generated by robots, you will no longer get spam comments by your website visitors with the intention to set an external link.