JQuery – How to hide your email from harvesting tools

It may sound a bit strange to few of the folks out there but it makes complete  sense. Some of you wonder where the hell these spammers get your email address from and bombard hundreds of email everyday, making your life as miserable as it could get. Ultimately you left with no choice but to abandon the email address you loved the most.

Painful!!!! isn’t it? (I guess, your answer is “yes”)

Web masters usually make a mistake of simply copy and and paste their email addresses on the web page.

Here is the way you can prevent spiders to understand your email address and make it readable for your human visitors.

I guess you folks probably have a general idea of JQuery if not then don’t you can find information about JQuery here. All you need to do is to import jQuery Library.

Now change all your email addresses from

<a href="mailto:dude@dudesworld.com">dude@dudesworld.com</a>
<span>dude at dudeswold dot com</span>

Once done with your HTML page then place the following code in <header><script></script></header> section.

var mailme = $('span.mailme');
var at = / at /;
var dot = / dot /g;
var address = $(mailme).text().replace(at,"@").replace(dot,".");
$(mailme).after('<a href="mailto:'+address+'" title="Send an email">'+ address +'</a>')
.hover(function(){window.status="Send a letter!";}, function(){window.status="";});

This is not the only way to secure your email from harvesting tools but still I Hope this will help!

This entry was posted in JavaScript, JQuery. Bookmark the permalink.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s