# Spammers beaten into submission?

**URL:** <https://boards.straightdope.com/t/spammers-beaten-into-submission/496752>\
**Category:** Miscellaneous and Personal Stuff I Must Share\
**Created:** [May 17, 2009, 4:00pm UTC](https://boards.straightdope.com/t/spammers-beaten-into-submission/496752 "2009-05-17T16:00:57Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Gary\_Robson](https://sea3.discourse-cdn.com/straightdope/user_avatar/boards.straightdope.com/gary_robson/32/3448_2.png) [@Gary\_Robson](https://boards.straightdope.com/u/Gary_Robson)\
**Post date:** [May 17, 2009, 4:00pm UTC](https://boards.straightdope.com/t/spammers-beaten-into-submission/496752/1 "2009-05-17T16:00:57Z")

</div>

A few weeks ago, I started [this Pit thread](http://boards.straightdope.com/sdmb/showthread.php?t=515331), in which I bemoaned the time I was wasting killing spam in the comments left on articles on my Web site, and wished unspeakable things upon the spammers.

I decided, instead of spending hours per week fighting them, I’d spend a little time doing research and a little time doing some coding, and see if I could eliminate the problem. I’m pleased to report that I haven’t had a “spam” comment on my site in over two weeks!

I did not put in a captcha. I hate those. Here’s what I did:

1. Disallow links in comments

2. Record the IP address when the form is delivered, and again on the submission page. If they don’t match, discard the comment.

3. Insert a field on the form, but use the style sheet to hide it. Bots find this field and fill it in, but humans don’t. Thus, if the field is NOT blank, I discard the comment.

4. Record the time when the form is delivered, and again on the submission page. If the form was filled in and submitted in less than 3 seconds, it’s a bot. Discard the comment.

Presto. An hour of coding, and the spam is gone!

---

<div class="post-metadata">

**Author:** ![gaffa](https://avatars.discourse-cdn.com/v4/letter/g/e68b1a/32.png) [@gaffa](https://boards.straightdope.com/u/gaffa)\
**Post date:** [May 17, 2009, 4:21pm UTC](https://boards.straightdope.com/t/spammers-beaten-into-submission/496752/2 "2009-05-17T16:21:48Z")

</div>

Very clever. Of course the spammers will re-code their bots as soon as they figure out #3 and #4. They might work around #2. But #1 is the same one that YouTube uses (though it is a drag for those of us who actually need a link to answer a question like “Where can I find more info about this artist?”)
