How To End Wordpress Comment Spam

7 replies
I really dont understand why people are creating these anti comment spam tools for Wordpress! Some of them are certainly creative but ending spam is extremely simple.

The only reason comment spammers are able to function is because all Wordpress sites use the same html pretty much for forms. All you need to do is edit the normal and all automated comment spammers wont work!

wp-comments-post.php

Find

Code:
$comment_author       = ( isset($_POST['author']) )  ? trim(strip_tags($_POST['author'])) : null;
Change to

Code:
$comment_author       = ( isset($_POST['SOMETHING ELSE']) )  ? trim(strip_tags($_POST['SOMETHING ELSE'])) : null;
comments.php (in WP TEMPLATE)

Find

<input type="text" name="author" id="name2" value="<?php echo $comment_author; ?>" size="50" tabindex="1" /></p>

Change to

<input type="text" name="MATCH THE 2 ABOVE" id="SOMETHING DIFFERENT" value="<?php echo $comment_author; ?>" size="50" tabindex="1" /></p>

It is that simple. Now comment spammers cant submit using your form because the cant locate the Author field.

Just make sure you change author to the same thing on both files. Then change the id= to anything you want.
#comment #end #spam #wordpress

Trending Topics