build-website-header
spacer-image

How to Hide an Email Address
and Stop Spam

 

Why should you  hide your email address from site visitors? Don't you want your visitors to email you?

Well yes you do but many new webmasters make the mistake of prominently displaying there email address on each web page only to find that they are inundated with spam.

However you cannot simply remove your email address as your visitor also need a way of contacting you, so you need to consider ways to hide it from the email harvesting tools.

 Here we will look at several different ways to hide your email address.

 

Hide Email Address by Inserting Additional Redundant Text

A simple way to obfuscate or hide your email address is to insert additional text into the email address making it effectively invalid. The text you insert into the text will be removed by anyone wanting to reply to you but not by a program. Therefore you need to make it obvious to anyone who will reply to you exactly what they need to delete.

As an example if your real email address is zebra@zulu1.com you would enter zebra@delete-thiszulu1.com.

Hide Email Address by Using JavaScript

 Instead of statically inserting the email address on the page you use client side java script to display the address correctly in the browser. A sample script is shown below all you need to do is to change the variable names recipient, host and email for your site. 

<p>Your feedback is important to us-thank you <p>

<script language=javascript>

  <!--

  var recipient = "steve"

  var email = "feedback"

  var Host = "oeupdates.com"

  document.write("<a href=" + "mail" + "to:" + email + "@" + Host+ ">" + recipient + "</a>" + ".")

  //-->

</script>

</p>

Hide Email Address by Using JavaScript and Encryption

This is the method I prefer and use. There are number of free tools that generate an encoded email address that appears as meaningless text to an email extractor but displays correctly in the browser and works correctly when clicked.

 The tools usually have a web interface where you enter your details in a simple form and the code is generate automatically for you. You then copy and paste the encoded text on to your web page. The one I use is at-

http://automaticlabs.com/products/enkoderform/

The above tool works only for HTML web pages if you want to encode your email address when posting at newsgroup forums or for use in plain text email then you can use the Advanced Email Link Generator
with Anti-Spam Encoder
. However you should note that this tool does not use encryption!

Hide Email Address by Using a Web Form

Instead of using the mailto tag to send mail you use the form tag instead. The user has to submit the form and a script processes the form and can then forward then the form to you via email ( see website forms or creating a contact page).

This is by far the most secure and easiest to implement but requires that your hosting provider supports scripting like PHP. If it doesn't there are many third party form providers but they usually display advertising on the form.

Use A Graphic

Many companies like to have their contact details at the top of every page. The easy way to do this is to place the contact details within an image and include it as part of the logo or as a small graphic next to the logo.

You can link the graphic to a contact page but it is not necessary.

Don't Put the Email Address on Every Web Page!

Include a link to a contact page on each page rather than a direct mailto or form on each page. By doing it this way if you change the email address or the method of contact you only need to change the contact page and not each page on your site.

See creating a contact page for details.

Related articles or Tutorials and Resources:

  • Extract Email Addresses
    Do you need to extract email addresses from web pages then you need extraction software like email extractor Lite 1.4.
  • Websites and Email-Websites and Email. What email capabilities do you get with your site and how do you use it.
  • Email Marketing- Learn how to collect email addresses and to use your email address lists effectively.