Anyone with a web site or blog probably knows that putting your e-mail address on the web brings in a wave of spam. Many spammers employ software called “spiders” that crawl around the web, examining web pages for e-mail addresses. Each e-mail address found by a spider is saved into the spammer’s database, and will soon begin to receive even more unsolicited e-mail.
You probably can’t stop every spider from harvesting your e-mail address from the Web, but there are a few tricks you can use to slow them down and fool a few. E-mail address obfuscation is the practice of making the display of your e-mail address overly complicated, so as to confuse the spiders. Real people visiting your site will not notice a change, but these unauthorized e-mail harvesting programs will have a tougher time reading your address. The two methods of e-mail address obfuscation we will cover are obfuscation by ASCII, and obfuscation by JavaScript.
Obfuscation by ASCII
ASCII codes are sequences of numbers that correspond to a letter, number, punctuation mark, or other printed symbol. An ASCII code in HTML begins with &#, which is followed by a number, and then ends with a semi-colon. By typing out your e-mail address and the mailto: link in ASCII, a spam harvester will not be able to spot your e-mail address by simply looking for the pattern [name]@[domain name].
The ASCII Text Converter (via Lifehacker) is a handy utility for automatically converting text into ASCII codes. First, type mailto:you@example.com into the ASCII text converter (replacing you@example.com with your own e-mail address). Take the output, and use that for the link.
Secondly, type you@example.com into the ASCII text converter (again, replacing you@example.com with your own e-mail address). Copy the output, and use that as the text of your link. Here is the final result:
<a href="paste output from step 1">paste output from step 2</a>
Here is a real-live example using my own e-mail address: tom@ofzenandcomputing.com. View this page’s source to see the ASCII in action.
Obfuscation by Javascript
Obfuscation by Javascript uses a Javascript function to write the HTML code for a mailto link to your address. This method assumes that the spam harvester only reads HTML and does not execute Javascript, and therefore would not run the Javascript function that displays your e-mail address. Evolt.org’s article “Spam-Proofing Your Website” has a simple, effective example of a Javascript e-mail obfuscation function.
There is one thing to keep in mind about this method: visitors who do not enable Javascript will not see your e-mail address.
Conclusion
Both of these methods are very popular for protecting e-mail addresses from spam harvesting programs. They will likely slow down most of the spiders out there, but there is no garauntee that they will completely stop them all. The are sure to be some advanced spiders that are able recognize the patterns used by e-mail address obfuscation, and circumvent them. You will probably never be able to completely stop the spam, but by all means take every preventative action possible.



