SEO Israel - Professional SEO Services

SEO & Digital Marketing


Anti Spam

» »

One of the most irritating things on the internet is spam mail. One of the ways spam senders find new email addresses to send spam to, is by scanning websites for new addresses. These are later sold to spam mail senders for thousands of dollars.

If you are interested in preventing these robots from finding your email address on your website (so that you will not be swamped with offers to enlarge certain body parts), you should keep reading this article.

How the robots find new Addresses

The robots find new addresses by scanning all of your site's pages, while looking for two things:

mailto: links: This is the simplest way to put a link to an email address on a website. Pressing this code will open the visitor's mail software, with the 'To' field already filled in with the email address that is stated in the code. This type of links is the main target for scan robots. Example:

<a href=""></a>

Forms: many websites contain forms that allow sending an email to the site's owner. Sometimes the target email address will appear in the code. For example:

<input type="hidden" name="email" value="">

Removing email addresses with JavaScript

The main purpose of using JavaScript is to change the link in a way that robots will not recognize as a link and move on. However, the techniques must keep the option for visitors to send you emails.

There are many techniques you can use, and I will present the one I currently use. With this method, the link is masked behind a 'span' tag instead of an 'a' tag and its components (mailto: @, and the period symbol) are also hidden. Add the next function in your page's JavaScript:

<script language=JavaScript>


function hide(n) {

n = n.replace(/^/, '@');

n = n.replace(/~/, 'mailto:');

n = n.replace(/`/, '.');





The above function receives a text, and replaces the following symbols:

  • ^ is replaced with @
  • ~ is replaced with mailto:
  • ` is replaced with '.'

After replacing, all that is left to do is replace our existing links with links that will look as follows:

<span onclick="javascript:nofollow('~bonbon^domain`com')">

If you want the link to look more like a regular link, you should add:

<span class=link onclick="javascript:nofollow('~bonbon^domain`com')">

Also, add this in the CSS section on the top of your page:

<style type="text/css">

.link { cursor: hand; text-decoration: underline; color: blue; }


That's it! From now on, robots will not be able to see your email, but users will.

Using the robots.txt file and the robots tag

It is quite obvious that spam robots that search for email addresses couldn't care less of what you think they can't do. They never bother to check the blocking rules in your robots.txt and robots tags that you put so much effort into.

A customer that couldn't find you is your competitor's customer..

Please fill in your site's details so that we can contact you as soon as possible and answer your questions:

SEO Israel, 1'st Hamada St., Rehovot 76703, Israel. (+972)-73-2240000
Contact SEO Israel
Info Center

Additional Resources:

SEO Blog (Hebrew)

Setting Up a New Site:

Domain Name Registration
Website Hosting

Search Engines Info:

Search Engines


Google Adsense
Internet Marketing
Link Development
Optimization Techniques
Web Analytics
Google AdWords

Our Company:

About SEO Israel
Contact Us
Our Clients
SEO/SEM Jobs in Israel
הסמכת גוגל AdWords הסמכת גוגל אנליטיקס
Site Map, Hebrew Site Valig XHTML 1.0
SEO Israel Facebook Page SEO Israel on LinkedIn Follow SEO Israel on Twitter SEO Israel on Google+