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!

link|improve this question

Why not use Akismet and/or captchas? – Raphael Nov 18 '10 at 13:50
feedback

1 Answer

up vote 6 down vote accepted

Create a file in wp-content/plugins/ with this code:

<?php
/*
Plugin Name: Get Rid of Comment Websites
*/
function my_custom_comment_fields( $fields ){
  if(isset($fields['url']))
    unset($fields['url']);
  return $fields;
}

add_filter( 'comment_form_default_fields', 'my_custom_comment_fields' );

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.

link|improve this answer
That did the trick - thanks! Created a folder called "remove-url-field" and created a file inside it called "remove-url-field.php" and then went and activated the plugin that showed up in the Plugins interface. Quick and easy! – cpuguru Oct 22 '10 at 16:51
2  
For simple plugins like the above it's not necessary to create a folder, a standalone file will work just fine.. (ultimately it's your choice of course, just pointing out it's not a requirement for plugins). – t31os Nov 18 '10 at 15:59
Is this really the simplest way? It seems odd that there are options in the admin for "Comment author must fill out name and e-mail" for example, but not to hide the Website field. – DisgruntledGoat Aug 3 '11 at 23:21
What is complicated about this? If you don't want to deal with FTP, I'm sure you could find something in the plugins repo that would do this. – John P Bloch Aug 4 '11 at 14:51
feedback

Your Answer

 
or
required, but never shown

Not the answer you're looking for? Browse other questions tagged or ask your own question.