In an effort to combat comment spam, I’d like to hide or remove the “Website” field from the “Leave a Reply” section for page and site comments.
I have no desire to increase others page rankings by having them embed their URLs in my sites comments, which seems to be what 99% of the comments on my site are wanting to do.
I’m using the Twenty Ten theme if that makes any difference in the answer.
Thanks!
Create a file in
wp-content/plugins/
with this code:Normally, I’d say put it into your theme’s functions.php file, but I wouldn’t recommend doing that for a theme that could update like Twenty Ten. This way will let you add this functionality as a plugin which can be disabled.
Apart from the good answer by John, I use a more straight forward solution, that allows me more control over the comment form and its fields.
By default, your theme’s
comments.php
(Twenty Eleven’s, for example) may have something like this â<?php comment_form(); ?>
Now, using
<?php comment_form(); ?>
is the same as:The only difference, AFAIK, is that the longer version gives you more flexibility. As in your case, you don’t want to show the website field. So, you simply remove the
url
parameter in thefields
array, and the end result is this:…which is what you need.
Recommended Reading: WordPress Codex Function Reference / comment_form
Source File: (trunk version â most current)
http://core.svn.wordpress.org/trunk/wp-includes/comment-template.php
Not a perfect solution, the other solutions are fine
Instead of modifying PHP, comments form, any how it’s just one input field, whats there if it is load and hided, Instead of writing
if
statements orrewrite
the comments formsimply hide the URL field
Removing the website field from comment form is quite easy. Below is the code with is just of few lines:
Source: How to remove the website field from WordPress comment?