Last Updated: February 25, 2016
· dpaluy

Protect Email From Spam Bots


Spam bots are getting a lot smarter at harvesting email addresses from web pages. Use encode option while using <a href="" target="blank">mailto</a>

Ways to protect your email:

  • Weak solution - substitute characters: meatdomaindotcom
  • Weak solution - HEX encoding: %6d%65@%64%6f%6d%61%69%6e.%63%6f%6d
  • Better solution - Javascript encoding:
mail_to "", "Contact us", encode: "javascript"

Check more details <a href="" target="_blank">here</a>.

Another way to encode your mail_to with JavaScript

<a href="" target="_blank">Email obfuscator script 2.1 by Tim Williams</a>

Important! You can't protect your email 100%

If the bot evaluates JavaScript before harvesting email addresses, you can't resist it.

For example, it can be done using <a href="" target='_blank'>PhantomJS</a>