What if I told you that you can protect your mailbox and your time from (most of the) spam with just one little trick? Don't believe me? Keep reading.
So I've got this theory, it might not be a new one, but it's my very first own theory, so bear with me. My little theory goes like this...
So everyone knows bots make most of the spam, right?
Most bots tend to fill in every field they can find on a website, usually with promotional stuff nobody want to receive in their inbox.
If you could add a field that should be empty when submitting the form, then you could validate this field. And if it's not be empty, then you just don't send the form. Right...
- <input id="blank-check" type="text" name="blank_check" value="" />
Well, this is in essence what the blank field does. Bots scan the DOM of the webpage, pick the fields and fill them in, including the blank field.
Now we lift this thing by hiding the field, so physical users cannot fill in this field. You do have to add some parameters in case somebody disables the styling or if they visit your page using a screenreader (like visually impared).
That leaves us with this code:
- <input id="blank-check" style="display: hidden;" type="text" name="blank_check" value="" placeholder="Please leave this field empty." />
That's pretty much my theory. I've applied it to some of the projects I've been working on for the last half year and as far as I've received the feedback from clients, they haven't received anymore spam.
If you've tried it yourself and received different results, I'm happy to take your feedback below.
So, what's your angle? Have you tried anything to prevent spam from being sent? And have you succeeded?