Anti Spam Javascript

From: Ed Zivkovic

How to Hide Your eMail Address from Robots

Ever wander why so many webmasters refuse to insert their email address into the body of their webpages?

The reason is to protect their eMail address from email harvesting robots. These robots crawl the Internet searching for email addresses in order to build a spam list.

These spambots ignore the robots.txt file. The robots.txt files is used to instruct legitimate web crawling robots about where they can and cannot go on your site. The file is observed by honest search engine robots but not by spambots.

Spambots will also ignore any instructions within the meta tags of your HTML. This means that they just go around doing what they want, violating your rights as a webmaster. Spambots are boundary violators just like the spammers who continue to do what they do. That is, send spam.

Many webmasters today have decided to use a contact form instead in an attempt to throw the spambots off. This has served a dual purpose for Internet Marketers.

    1. To keep the eMail address safe from spambots.

    2. Another webpage to use for the purpose of channeling Page Rank (PR).

The contact form works fine, but just in case you find the need to add your eMail address into your webpages, you can use some JavaScript to hide the eMail from the spambots.

Below you will discover two Free JavaScript resources. These JavaScripts are easy to use if you have access to the HTML of your webpages. They can be added to any webpage quickly and easily.

The Unspamable eMail Link JavaScript

If you would like to display your eMail link to humans but hide it from spambots, you can use this Free cut-and-paste Unspamable email link JavaScript from:

How to Edit the JavaScript

Select the JavaScript from the textarea then copy and paste it into your HTML document. For help with copy and paste, visit:

You will notice two variables within the script:

var name = "protected";
var domain = "";

To insert the email address, simply replace the word protected with the word webmaster and replace the domain with That's it.

Automatic Encoding Tool

This tool is easy to use. Just insert the email address you wish to protect and click the button called "Encode mail links":

Also, you will need to download a small file called "email.js" and upload it to your website. Full details about this system are available at:

Advantages and Disadvantages

JavaScript - Adding an email address builds trust with your visitors because when they click your email link, their mail browser opens and they know that when when they click the send button, it is going directly to you.

Contact Form - With a contact form, you are sending valuable Page Rank to yet another page on your site. From that page, you can send more Page Rank to still other pages.

Note to Content Management Software Developers

Some article submission services publish authors articles along with the email address of the author. In this day and age, this is unacceptable. I would call this version "the barely ready beta version". In other words, it is ready for BETA release after this problem is fixed.

If you develop Article Publishing software, and the published articles include the authors eMail address, you are on a losing streak. I have spoken to owners of this type of software and they are on the lookout for something better.

This applies to other types of software scripts which publish HTML with an eMail address. Not everybody wants to open up free eMail dumping accounts.

The author, Ed Zivkovic is the webmaster at Home Business Webmaster Tips. The site contains many useful tips for work at home webmasters.

This article may be re-published on your website or ezine.