Back to Knowledge Base
Knowledge Base Email How to protect your email from spambots?

How to protect your email from spambots?

Email 07/11/2026
<p><span style="font-family: arial, helvetica, sans-serif; font-size: small;">Solution</span></p>
<p><span style="font-family: arial, helvetica, sans-serif; font-size: small;">
<p style="font: normal normal normal 11px/normal Verdana, Tahoma;">Are you protecting your email addresses?</p>
<p style="font: normal normal normal 11px/normal Verdana, Tahoma;">Spammers get your email address by using evil automatic software that scours your website. When they find something like "mailto:[email protected]", they put you on their spam lists. These software are known as "spambots".</p>
<p style="font: normal normal normal 11px/normal Verdana, Tahoma;">Techniques for avoiding the spambots have been around for years, but it's surprising how many webmasters aren't using them.</p>
<p style="font: normal normal normal 11px/normal Verdana, Tahoma;">To protect your email addresses, here's a simple bit of code that robots won't be able to harvest, at least with their current techniques:<br />&lt;script language=javascript&gt;<br />&lt;!--<br />var linktext = "THIS APPEARS ON THE PAGE"<br />var email = "sarah"<br />//replace sarah with your email username<br />var emailHost = "YourDomain.com"<br />//replace YourDomain.com with your domain name<br />document.write("&lt;a href=" + "mail" + "to:" + email + "@" + emailHost+ "&gt;" + linktext + "&lt;/a&gt;" ) <br />//--&gt;<br />&lt;/script&gt;</p>
<p style="font: normal normal normal 11px/normal Verdana, Tahoma;">If you want to show your email address, use this instead (do not use the above code and replace the linktext with your email address):<br />&lt;script language=javascript&gt;<br />&lt;!--<br />var email = "sarah"<br />//replace sarah with your email username<br />var emailHost = "YourDomain.com"<br />//replace YourDomain.com with your domain name<br />document.write("&lt;a href=" + "mail" + "to:" + email + "@" + emailHost + "&gt;" + email  + "@" + emailHost+ "&lt;/a&gt;" ) <br />//--&gt;<br />&lt;/script&gt;</p>
<p style="font: normal normal normal 11px/normal Verdana, Tahoma;">Put this code on your pages, making sure to replace all instances of your old "mailto" HTML code.</p>
<p style="font: normal normal normal 11px/normal Verdana, Tahoma;">Some other ways to protect your email:</p>
<ul>
<li style="font: normal normal normal 11px/normal Verdana, Tahoma;">Image to display your email</li>
<li style="font: normal normal normal 11px/normal Verdana, Tahoma;">Use online form submission</li>
</ul>
</span></p>
Was this article helpful?