Button-mashing detected: a duplicate comment filter

November 5th, 2007

Here’s a feature every website with comments should have: automatic detection of duplicate comments. We’ve all done it; the page is taking a little too long to load, so we start hammering on the “Submit” button over and over again until it finally goes through and we’re horrified to see we’ve managed to post our comment twice.

I was reading one of my favorite websites today - TheSimpleDollar.com - and ran into that situation. Luckily WordPress has this functionality built-in, and sends you to a page that tells you “Duplicate comment detected, it looks like you already said that!”

I’ll try and remember to include this type of feature into any future projects I develop. The code should be relatively easy; just a database call to the last comment made by that user to see if they match.

5 Responses to “Button-mashing detected: a duplicate comment filter”

  1. nathan Says:

    nice post

  2. nathan Says:

    nice post

  3. Kai Schaller Says:

    Oh I see what you did there… :-P

  4. 25 Says:

    Oh I see what you did there… :-P

  5. Kai Schaller Says:

    To our anonymous tester: it would seem a bit silly for software to claim that a comment made 9 months after another could count as a duplicate, especially since the user info (name, email, etc.) doesn’t match.

Leave a Reply