1. Computing
Give the Spammers' Harvesting Robots No Chance
Spammers often use robots to collect email addresses from Web sites. Here's how to avoid this while still having your address available.
 Join the Discussion
• Recent Discussions
 
 Related Resources
• Spam Fighting Tips
• Anti-Spam Tools for Windows
 
  Free Newsletter
Your email address:

Harvesting Email Addresses

Spammers naturally need email addresses for their mailing lists. While they can simply invent addresses if their only purpose is to sell these lists with the argument of sheer size, even then it would be nice if the addresses worked.

A very good source that is easy to use are Web sites. They are a good source because creators of a page usually want their visitors to have a means to contact them; what better means could there be than email?

Web sites are a source that is easy to use because the specified structure (HTML) makes them a target for robots. They scan the pages for mailto: links and -- voilà -- this is where the email addresses are.

For webmasters, this creates a conflict of interests: on the one hand, they want to give the visitors of their creation an easy way to contact them -- email, on the other hand they strive to keep their email address from being collected by spammers.

One popular way to achieve this is to modify the email address so that it can be "read" by humans but not by robots. Usually, some easily identifiable part is inserted, as in "emailNOSPAM@aboutguide.com", possibly with instructions to remove NOSPAM from the address before sending a message.

It uses JavaScript to make the email address appear and work for humans accessing the page with their browser normally; a (current) harvesting robot will, however, not find any email address.

All you have to do is to replace any occurrence of your email address on a Web page that looks like <a href="mailto:me@example.com"> me@example.com </a> with the following JavaScript code:

<script language="JavaScript">
<!--
document.write('<a href="mailto:' + 'me' + '@' + 'example.com' + '">');
document.write('me' + '@' + 'example.com' + '</a>');
//-->
</script>

This code will make your (and please really use yours, not mine) email address appear like this:

The Downside

Currently, the only downside to the JavaScript-method is that visitors to your site have to use a browser that is capable of handling this basic JavaScript (depending on the target group this may be up to 99%) with JavaScript turned on.

In a future that may not be too far away harvesting robots will be modified to understand (the necessary) JavaScript, too. Unless a lot of email addresses are encoded with JavaScript could still take some time, though, because it will not be "necessary".

"And the ripe harvest of the new-mown hay
Gives it a sweet and wholesome odour."

Colley Cibber
Richard III

Discuss in my forum

©2014 About.com. All rights reserved.