One of my clients came to me with a problem: people would leave comments and those who didn’t have a website would type n/a, none, or some other random word in the website field when leaving a comment. It seems they didn’t realize they could leave it blank if they didn’t have a website or blog to link to.
This was a relatively simple problem to fix with only one small tweak to the comments.php and comments-popup.php template files. Delete the website input field from the form. In the end, it didn’t hurt the number of comments left; however, it did cut down on the number of comments with random text for websites.
I’m sure you’re wondering what those people who do have a website are to do. Well, those people generally figured out they can place the link in the actual comment body or that they can register for an account on the blog (if registration is allowed) and add the link in their profile.
The How-To:
In your theme folder, locate the comments.php and comments-popup.php template files. The example below will assume you’re using the default (Kubrick) theme.Make sure to back up your files before editing, then find the following and delete it (or comment it out):
<p><input type="text" name="url" id="url" value="<?php echo $comment_author_url; ?>" size="22" tabindex="3" /> <label for="url"><small>Website</small></label></p>(To comment out a block of code, add
<!--before it and-->after it.)
This may not be the ideal solution for every blog, but it’s a healthy solution for blogs that get a lot of non-blog-savvy readers. An alternative would be to add a note before the website field asking readers without a website to leave the field blank. (By the way, I’ve tried the alternative with marginal success. Some people simply don’t read, comprehend, or follow instructions well.)



I would prefer some logic in the code to look at the characters in the field, then varify that they contain one of the valid endings to a domain name. For examlple, it must contain .com, .net, .org, ..ect.
A list of valid domain suffix can be found at http://www.norid.no/domenenavnbaser/domreg.html
# May 14th, 2007
Hi Eric,
In general, I agree with you. However, to accomplish the checks necessary would require far more tweaking and coding (which could possibly involve modifying core files) than the simple fix of removing the URL option and in some cases it would be overkill, plus it wouldn’t account for the people who put in random URLs (e.g. google.com, msn.com, aol.com, & so forth).
Removing the URL field isn’t a new idea; certain publications that don’t warrant a majority of their users leaving a link will remove the option, for instance The New York Times blogs, without adversely impacting the interaction of their readership.
For the blogs that don’t need to worry about such a problem, URL checking/field removal isn’t necessary. Using this one as an example, I leave it intact because a majority of the commenters will understand that it’s optional and it’s extremely rare that I receive a gibberish URL (that isn’t attached to a spam comment).
~ Teli
# May 14th, 2007
I think leaving a website is not a bad option to have. It encourages people specially who have blog to pass sometime valuable comments about your site.
# November 13th, 2007
You can leave “Website” field, but just check if it contains “http://” or not. It’s a more correct way, I think.
# January 13th, 2008
Better to have there a website name as default! So if we commenters want to change it, we can, otherwise, we will leave it unchanged!
# February 10th, 2008
actually i’ve commented out the email and website fields. the result is an error message that says
Error: please fill the required fields (name, email).
now what?
# July 16th, 2008