1. Home
  2. Business & Finance
  3. Women in Business

Tips for Managing Spam Emails - JavaScripts
Using a JavaScript to Obfuscate Email Addresses

By Lahle Wolfe, About.com

How Can I Disguise My Email Address from Spam Robots?

There are many ways to obfuscate an email address:

  • Use an image instead of text;
  • Substitute the @ sign for the word “at;”
  • Use a hexadecimal code instead of the @ symbol;
  • Use form email;
  • Use a disposable email address service;
  • Use a simple JavaScript.

Why I Prefer JavaScripts to Obfuscate Email Addresses

My favorite robot foiler is the last option above – JavaScripts. Robots will have a near impossible time gathering your email address, it is fast and simple, and requires no set-up like email forms.

If you use a JavaScript your site visitors will be none the wiser; it is free and easy to set up in seconds, and, even better, you do not need to pay for a “disposable” email address.

Example of Obfuscated Email Address Using a JavaScript

Let’s say you want to put the email address on your web site haha-robots@mydomain.com. If you create a basic HTML code as a hyperlink using mailto: command a robot will easily locate and identify your email address.

This is how it would look to robots:

<a href=mailto:haha-robots@mydomain.com>Haha Robots</a>

A robot will search for mailto: commands and “@” signs. In the above example, a robot would have no trouble locating and identifying our fake email address.

Even if you obfuscate the @ sign in the HTML code, if you put the email address in the hyperlink display, robots will pick it up. In other words, if you can read the email address in the code OR on the web page – consider it fodder for spam robots.

Can You Read This?

Even if you do not use HTML code to make an email hyperlink, an exposed email address in text is still vulnerable to spam harvesting robots:

To contact us at We Hate Spam Mail, Inc., email: haha-robots@mydomain.com.

Remember, if you can read it, so can a robot.

Example of Obfuscated Email Address Using a JavaScript

Now, can you read this?

<a href="javascript:location='mailto:\u0068\u0061\u0068\u0061\u002d\u0072\u006f\u0062\u006f\u0074\u0073\u0040\u006d\u0079\u0064\u006f\u006d\u0061\u0069\u006e\u002e\u0063\u006f\u006d';void 0">Haha Robots</a>

Neither can a robot. The above is an example of a simple JavaScript that disguises an email address. Your site visitors will see a hyperlink: “Email Ha Ha Robots,” but robots will only see the string of code.

Best Five, Free Email Obfuscators: Now that I have you convinced you should disguise your email addresses, you can use one of these five free tools to get the job done.

Explore Women in Business
About.com Special Features

Start your new business on the right foot with these helpful tips. More >

Easy steps to take control of your credit card debt. More >

  1. Home
  2. Business & Finance
  3. Women in Business
  4. Internet Businesses
  5. Managing Email Spam
  6. Tips for Managing Spam Emails - Use a JavaScript to Obfuscate Email Addresses>

©2009 About.com, a part of The New York Times Company.

All rights reserved.