A simple trick to reduce inbound spam

The mailto tag in HTML provides a simple way for a website visitor to contact you by email using a hyperlink. For instance:

<a href="mailto:johndoe@mydomain.com">Email John Doe</a>

Unfortunately, if your website uses this tag — and most do — automated web crawlers will eventually find it and add your email address to their library of spam target lists.

An easy workaround is to use JavaScript. Simply replace the mailto line in the HTML with these lines:

<script type="javascript">
document.write("<a href='mailto:" + emailname + "@" + emailserver + "'>");
document.write(emailname + "@" + emailserver);
document.write('Email John Doe');

This code breaks apart the elements of a typical HTML mailto line of code in a way that spam crawlers can’t re-assemble. Voila, you now have an email hyperlink that spam crawlers won’t find!

One response to “A simple trick to reduce inbound spam

  1. Trent A. Reynolds


    This tool is obsolete, as some (not all) Spam-bots know how to get it around it, but it’s handy if you’re in a hurry.

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