Obfuscate email, but make your self email-able

May 15, 2008

Using a simple obfuscating script on your website's published email addresses can reduce the amount of email spam by 90% or more. Email spam primarily comes from email harvesting bots, similar to search engine bots, that scour the internet looking for email addresses to spam. There are several ways to obfuscate email addresses.

Common methods to obfuscate email addresses:

  • Encoding
  • Javascript
  • Flash
  • Using an Image instead of text

Javascript and Flash obfuscation basically create a text version of your email that cannot be read by all but the most complex email harvesting robots. These methods work well at stopping email harvesting (Flash is far better than Javascript), but your visitors must have flash installed or javascript enabled for these to work or they too cannot see your email address.

Example of what a Javascript email would look like to a computer. (From: seowebsitepromotion.com)
<script type="text/javascript">
//<![CDATA[
var email = "questions"
var domain = "ecommerce-blog.org"
document.write("" + email + "@" + domain + "")
//]]>
</script>

These can also be called externally or through an action script which is even more effective.

Images of an email address can be used in place of text. While this is probably as effective at stopping spam as flash and Javascript, it completely prevents copying the text. This makes it very annoying to try and email the site owner as contact addresses are often long and can be complex. Users are very prone to mis-entering email characters and this generally leads to frustration and annoyance by everyone. I recommend not using this method.

Encoding is by far my preferred method of email obfuscation. While it is not as effective as the other methods, it stops the majority of spambots. It does not create browser compatibility or usability issues. It is as easy to use as copying and pasting some html onto a web-page when it is being created.

Encoding can be done with a hex, decimal, and others. HTML interprets these encoded characters as the ones we see and read. This way your visitors sees an A while a computer sees an &#x41;.

Some good encoding tools:
http://www.ianr.unl.edu/email/encode/ - This is a simple and very effective encoding generator.
http://www.seowebsitepromotion.com/obfuscate_email.asp This script offers a variety of encoding and javascript obfuscation techniques.

Email Obfuscation Comparison:

Method Usability Effectiveness Difficulty
Flash Bad Extremely Good Hard
Javascript Ok Very Good Medium
Image Bad Very Good Medium
HTML Encoding Great Good Easy

Comments

5 Responses to “Obfuscate email, but make your self email-able”

  1. sun on May 15th, 2008 10:20 pm

    LOL, I had to laugh when you suggested using Flash to obfuscate e-mail. I think images are fine. Having a long, complex, and/or annoying e-mail address is a usability issue in general that typing out makes apparent. Just use a simpler prefix or be considerate of domain names usability before registering.

  2. jestep on May 20th, 2008 6:15 pm

    Flash is certainly a ridiculous method to obfuscate anything, but I included since I have seen it a few times. Javascript is probably safe nowadays since the vast majority of users have javascript enabled.

  3. Shopping Cart Software on May 21st, 2008 10:23 am

    This is actually a good idea. I might use this in my personal site aswell.

  4. Rich on May 28th, 2008 7:07 pm

    @jestep: No need to worry about users not having javascript installed. Remember that you can use < noscript > tags to provide content for users that have disabled javascript. Then, you can provide an image (less usable, but very secure) or something like that. Check it out in action my site if you like:
    http://featurific.com/node/23

  5. SengHooi Dot Com on June 12th, 2008 10:54 pm

    I see a lot of people write their email in this way :
    senghooi429[at]yahoo[dot]com.

    I notice myspace and facebook will auto convert your email into this format.

    So…its to preventing spam ?

Got something to say?