Adding an email address to a website is a useful way to allow customers to make contact. Unfortunately, it’s also a way for “spam bots” – programs spammers use to collect email addresses from websites – to harvest the email address to send unsolicited messages or advertisements.
Ecommerce merchants have several options to hide or obscure that email address from spam bot programs and still make it accessible and user-friendly for customers. Below is a listing of some of the more popular methods and simple step-by-step instructions on how to employ them, each one progressively more hidden, or “obfuscated.”
The most common way to embed an email link into a page is by using this simple HTML code below, generally referred to as “plain text”:
On screen this appears as a clickable link, reading: firstname.lastname@example.org.
This method allows for visitors of a site to simply roll a cursor over and click on the email address provided. Generally, this automatically opens up a visitor’s email management program like Microsoft Outlook or Mozilla Thunderbird with the email address already copied.
Plain text, although the simplest and most user-friendly, provides no obfuscation.
Instead of displaying the actual email address on the web page, merchants can write a simple phrase like “Send a message” for a method that is both user-friendly to read and adds a layer of hidden protection from spammers. So, an email address that actually looks like this: “email@example.com” will read like this on screen “Send a message.”
The HTML code for this example is below:
<a href="mailto:firstname.lastname@example.org" title="Send a message">Send a message</a>
On screen, this appears as a clickable link reading: Send a message.
This provides a thin layer of obfuscation and is just slightly better than the “plain text” method.
In the example below, “Email Address” is the visible link text and when clicked the hidden email appears copied in the user’s email management program, ready to send.
On screen, the link would look like this: email@example.com.
“ROT13” may sound scary, but it’s a simple and effective way to add a more sophisticated layer of obfuscation. Put simply, ROT13 or “rotate by 13 places,” replaces each letter in a given piece of text by a letter 13 places further along in the alphabet, wrapping back to the beginning of the alphabet if a letter is towards the end.
Only letters that occur in the alphabet are rotated. Spaces, symbols and other characters are left unencrypted. For example, the letter “a” would be replaced by the letter “n” – 13 places over in sequence.
- Type in the plain text of the email address to be encrypted into the first field on screen. Be sure to include the text “mailto:” before the email for the HTML code step later on. It should look something like this when typed out: mailto:firstname.lastname@example.org. In this example, the online ROT13 encryption generator automatically encrypts and displays that email address in the second box on the page, as the original text is typed. Encrypted, it looks like this: znvygb:email@example.com.
document.write("<n users="znvygb:firstname.lastname@example.org" query="absbyybj">Fraq n zrffntr</n>".replace(/[a-zA-Z]/g,
</script>Send a message</a>
This code above will create a link that cleanly reads Send a message on your website.
Avoid obfuscation code and email-address exposure altogether with a website contact form, where email addresses are not displayed at all and customers can easily make contact, leaving a name, email address and message that merchants can respond to when necessary.
Merchants can simply sign up for a contact form service, choose the desired fields (name, email address and message are the most common), follow the on-screen instructions, and the HTML code for the contact form is generated. Merchants can then copy and paste the code into the website source code.