Welcome to the online home of Tim Challies, blogger, author and web designer. My first book, "The Discipline of Spiritual Discernment," is now available everywhere.

Read about the blog or about the author.

Monday January 24, 2005

Spam-Proof Your Email Address

Spam is annoying. Really annoying. What is especially annoying is when you post your email address on your web site and those spammers send their bots to automatically glean your site and scrape all those addresses into their ever-growing databases. We all hate it. What I see more and more often these days is people posting little work-arounds like “myname att challies dott com”. That is not terribly effective. Plus, ideally, we’d like people to be able to just click on the link and have Outlook or another mail program open up. I think I have found a solution. Or, to give credit where credit is due, I think my friend Dave has found a solution. A simple little JavaScript seems to keep those programs from automatically finding your address. Here is how I do it:

<script language=”javascript”>
str=”;
str=str+’<a href=”mail’;
str=str+’to:’;
str=str+’m’;
str=str+’y_’;
str=str+’email@ch’;
str=str+’a’;
str=str+’lli’;
str=str+’es.c’;
str=str+’om’;
str=str+’”>click here</a>’;
document.write(str);
</script>

Of course if you were to use this script on your site, you would have to use your address instead of mine. All the script does is break the email address into fragments. A bot that comes to the site will see and ignore the script. However, if you click on the link, you will get the usual link that opens your email application () That is a fake email address, so don’t bother using it to write to me! It’s that easy. I cannot categorically say that it works perfectly, but I do know I have run this script for a long time now and have never gotten any spams at that particular address, so it seems to be doing the trick. At the very least, it provides some level of protection for your email address and is significantly less-annoying than cryptically writing out your address in long-hand.

Amazon