WordPress Comment Spam
If you have a blog, you will get comment spam. Comment spam is like fax spam or e-mail spam except its people trying to sell stuff by posting advertising in comments to your blog.
A lot of the more complicated solutions sound a little half-baked, annoying, too much work, or just plain insane. I absolutely hate some of the “type in the word that appears in this image” because half the time I can barely make it out with my feeble HUMAN eyes … argh!
Well, I just read an even simpler solution, and since I was working on my
comments.php I thought I’d give it a shot. It basically boils down to:
- Edit your
wp-content/themes/default/comments.php(or whatever theme you are using) and change the line that references the “email” form field to something else. I’ve changed to “dtcemail”:
<p><input type="text" name="dtcemail" id="dtcemail"
value="<?php echo $comment_author_email; ?>" size="22" tabindex="2" />
<label for="dtcemail" ><small>Mail (will not be published) <?php if ($req) _e('(required)');
- Edit you
wp-comments-post.phpand change the
$comment_author_emailassignment to whatever you changed your e-mail to, above:
$comment_author_email = trim($_POST['dtcemail']);