Prevent Spam by Encoding your Email Adresses

5 August 2009
If you have your email published on your (or any other) site, and this site is being indexed by search engines, eventually you will end up with a mountain of spam in your inbox.

If you have your email published on your (or any other) site, and this site is being indexed by search engines, eventually you will end up with a mountain of spam in your inbox.

Why is this you ask? Basically “spam bots” as they are called, are gathering email addresses from the internet, they work by using the search engines to find and look through sites, getting every email address they see. To fight the spam bots we need a way of preventing these little guys from taking our addresses while of course leaving a way for our visitors to see them.


A Simple Approach



This approach is widely used although not the safest ( much better than just typing your address as it is of course).
Here is how its done, when writing the email address we change it a bit. Example:

info [at] domain.com

myemail (at) domain.com

This leaves it still readable by humans although a little less bot friendly. You can vary the form (maybe you like using {} instead), to make it match your style.


Encoding your Email



Another approach (my favorite) is to obfuscate the email in the source code, using a javascript code that reconstructs the address on the client side. While this sounds complicated its invisible for the end user and prevents the bots from seeing the address as most can not execute javascript.

Here’s a couple of resources that do that for you (they give you a javascript code based on the address you want to encode):

www.Rumkin.com
Mail encoder: very cool tool, has a lot of options.

www.MailToEncoder.com
a simple but powerful encoder we put together as one of our weekend projects ;)

Encode!



Go ahead and encode the addresses you have published on your site, is never too late to fight spam!

Best Viewed at Malbec Media . com !

 

blog comments powered by Disqus