Hide your Email Address Using Microformats

Heres a little tip to hide your email address on your site, so that it is only visible to people with microformat readers.

Suppose I wanted to advertise an email ‘kunaal@somedomain.com’, normally you would not put that on your website for fear of getting your email inbox choked with spam. Here is another little trick to hide your email address from everyone without a microformat reader.

Normally, you would write your email address using microformats as so - Kunaal Ramchandani can be contacted on , which in the code would appear as

<span class="vcard"><span class="fn">Kunaal Ramchandani</span> can be contacted on <span class="email"><span class="value">kunaal@somedomain.com</span></span></span>

Now an ordinary scraper can easily pick up the email address mentioned in there, so to get around that we introduce random characters in between the email address, but put them outside the <span class=”value”> tags. What I mean is that I separate each character of the email address in a <span class=”value”> tag, and I write random letters in between each <span class=”value”> </span> pair, i.e for ‘kunaal’ I would convert it to

<span class="value">k</span>
<span class="value">u</span>
<span class="value">n</span>
<span class="value">a</span>
<span class="value">a</span>
<span class="value">a</span>
<span class="value">l</span>

and then introduce random characters like #,$,! random letters etc in between, making the final code look like

<span class="email"><span class="value">k</span>##<span class="value">u</span>!!<span class="value">n</span>@@<span class="value">a</span>$$<span class="value">a</span>%%<span class="value">l</span>^^<span class="value">@</span>**<span class="value">s</span>((<span class="value">o</span>))<span class="value">m</span>!!<span class="value">e</span>@@<span class="value">d</span>##<span class="value">o</span>$$<span class="value">m</span>%%<span class="value">a</span>^^<span class="value">i</span>**<span class="value">n</span>((<span class="value">. </span>))<span class="value">c</span>!!<span class="value">o</span>@@<span class="value">m</span>##</span></span>

On screen this would appear as .

This would make it unreadable to your average person and your normal everyday address parser, and only visible to a microformat parser!

Leave a Reply