Smartlab Software logo

Hide Email Address from Spambots

Here are helpful ways to hide your email address from spambots. If email addresses directly exist on your web page, such as: (at = @)

mailto:info at mydomain.com

That is an open invitation for email harvesters. There are several ways to mitigate the spambots from this malady.

Use <code>

Adding <code> around the @ sign will put most spam bots at bay. <code> as defined in HTML puts any text in between it in monospace font. Other than that its effect is unspecified.

news<code>@</code>mydomain.com

Use Special HTML Characters

The easiest way is to replace the @ sign in your email address with the "&#64;" but not the most secure.

Put it in your code inside a link or just as a text email address:

Link: <a href="mailto:news&#64;mydomain.com">Email Us!</a>

Text email: Email us at: news&#64;mydomain.com

Since the HTML code doesn't look like a proper email address, the email spider doesn't harvest it but the browser understands the code and displays it properly. Visitors will be able to send you mail from the linked address if they have their mail client configured to do so otherwise they can cut and paste from your Web page into their mail client.

Hide Email Address using JavaScript

This JavaScript is for providing a clickable email address but hides the email address from spambots.
Put anywhere on your page between <body> and </body>. This will generate a line that looks like:

Email: info at mysite.com

<script type="text/javascript">
<!-- Begin
user = "info";
domain = "mysite.com";
document.write('E-mail: <a href=\"mailto:' + user + '@' + domain + '\">' + user + '@' + domain + '</a>');
// End -->
</script>
<noscript>put image of email address here</noscript>

Use an Email Form

The most secure way is to use an email form. It requires putting a script on your server. Check with your host provider - they may have scripts available.

Spell it Out

If clicking on an email address to launch the default email program is not an issue, another alternative is to spell out the email address. For example:

myname at mydomain dot com