Subscribe via RSS FeedRandom Post

Reduce WordPress Spam By Creating Fake Comment Forms For Spam Bots

View Comments February 16, 2007 | Tony Williams

Last month I gave tips on how to eliminate WordPress Spam forever. Today I’ve got an ever better tip for reducing comment spam on WordPress blogs, but should also work on other sites with comment forms.

My friend Billy came up with a neat mod to trick these spam bots on my site, which is increasingly coming under attack. Most comment spam comes from spam bots that try to post comments to the first comment forms they see. So, what I’ve done on this blog is create a few fake forms that are placed in front of the real comment form, and are invisible to real readers. This means that the stupid spam bots try and post spam to these forms first, and never make it through to the real forms so I never see the spam!

To add fake comment forms to your site do the following:

Create the Fake forms

  • In your WordPress comments.php file look for the following lines:
  • <?php else : ?>
    <form action="<?php echo get_option('siteurl'); ?>/wp-comments-post.php" method="post" id="commentform">

  • Directly inbetween these lines add the following:
  • <?php /* ===============================fake =======================================*/?>
    <div style="display:none;">
    <form action="<?php echo get_option('siteurl'); ?>/fakecommentform.php" method="post" id="commentform">
    <input type="text" name="author" id="author" value="" size="22" tabindex="1" />
    <input type="text" name="email" id="email" value="" size="22" tabindex="2" />
    <input type="text" name="url" id="url" value="" size="22" tabindex="3" />
    <textarea name="comment" cols="20%" rows="10" tabindex="4">1</textarea>
    <input name="submit" type="submit" id="submit" tabindex="5" value="Submit Comment" />
    <input type="hidden" name="comment_post_ID" value="<?php rand(2000,5000); ?>" />
    </form>
    </div>
    <div style="display:none;">
    <form action="<?php echo get_option('siteurl'); ?>/fakecommentform.php" method="post" id="commentform">
    <input type="text" name="author" id="author" value="" size="22" tabindex="1" />
    <input type="text" name="email" id="email" value="" size="22" tabindex="2" />
    <input type="text" name="url" id="url" value="" size="22" tabindex="3" />
    <textarea name="comment" cols="20%" rows="10" tabindex="4">1</textarea>
    <input name="submit" type="submit" id="submit" tabindex="5" value="Submit Comment" />
    <input type="hidden" name="comment_post_ID" value="<?php rand(2000,5000); ?>" />
    </form>
    </div>
    <?php /* ===============================fake end =======================================*/?>

    so that your comments.php now looks like this:
    <?php else : ?><?php /* ===============================fake =======================================*/?>
    <div style="display:none;">
    <form action="<?php echo get_option('siteurl'); ?>/fakecommentform.php" method="post" id="commentform">
    <input type="text" name="author" id="author" value="" size="22" tabindex="1" />
    <input type="text" name="email" id="email" value="" size="22" tabindex="2" />
    <input type="text" name="url" id="url" value="" size="22" tabindex="3" />
    <textarea name="comment" cols="20%" rows="10" tabindex="4">1</textarea>
    <input name="submit" type="submit" id="submit" tabindex="5" value="Submit Comment" />
    <input type="hidden" name="comment_post_ID" value="<?php rand(2000,5000); ?>" />
    </form>
    </div>
    <div style="display:none;">
    <form action="<?php echo get_option('siteurl'); ?>/fakecommentform.php" method="post" id="commentform">
    <input type="text" name="author" id="author" value="" size="22" tabindex="1" />
    <input type="text" name="email" id="email" value="" size="22" tabindex="2" />
    <input type="text" name="url" id="url" value="" size="22" tabindex="3" />
    <textarea name="comment" cols="20%" rows="10" tabindex="4">1</textarea>
    <input name="submit" type="submit" id="submit" tabindex="5" value="Submit Comment" />
    <input type="hidden" name="comment_post_ID" value="<?php rand(2000,5000); ?>" />
    </form>
    </div>
    <?php /* ===============================fake end =======================================*/?>
    <form action="<?php echo get_option('siteurl'); ?>/wp-comments-post.php" method="post" id="commentform">

Tip: Click here to run a free scan for common PC errors

GD Star Rating
loading...

Tags: , , , ,

Category: Using The Internet

Next Post: »»

Prev Post: »»

About Tony Williams: Want to get more out of your PC, the internet or your mp3 player? Onetipaday.com is here to provide clear simple tips and guides to help you achieve just that. Each tip will be easy to implement and will take no more than 5 minutes to read and implement. What will you learn today? View posts.

Comments (View Comments)

Trackback URL | Comments RSS Feed

  1. What is it, kim kardashian sex tape free [url=http://cre.ations.net/creator/kimkardashiansextape#1]kim kardashian sex tape free[/url], :-))),

Leave a Reply




If you want a picture to show with your comment, go get a Gravatar.

blog comments powered by Disqus