Snippet. Hide E-Mail from Spiders

This little snippet allows you to hide your e-mail from mail harvesting spider bots. It hides the email and displays it using JavaScript. Optionally, it allows if JavaScript is disabled to show an image with the e-mail.

<script>
    var user = "mymail";var host = "myhost.com";var link = user + "@" + host;
    document.write("<a hre" + "f=ma" + "ilto:" + user + "@" + host + ">" + link + "</a>");
</script>
<noscript>
    <img src="mymail.png" alt="" />
</noscript>

Updated on: 19 Apr 2024