WordPress – How to hide or obfuscate your email address from spambots

Last Update: 15 March 2019

Tested: WordPress 5.1.1

All too often, I visit websites and email address are displayed in full using HTML.

<a href="mailto:name@domain.com">name@domain.com</a>

I consider this as sloppy coding! Now the client has to deal with an enormous amount of spam arriving in their inbox.

Initially, you can reduce unsolicited email spam by hiding or obfuscate all email addresses on a website before you go live.

In this way, spambots and list builders can’t harvest the email address.

There are multiple ways you can “disguise” an email address.

  • CSS pseudo-classes
  • CSS reverse character sequence
  • Including HTML comments
  • Converting to HTML character codes
  • Adding “remove” elements.

No matter which way you approach these methods the outcome is the same. Either spambots have worked out how to decipher the email address or, the active hyperlink is lost, requiring the user to copy paste or edit the email address – resulting in decreased usability.

Check the venerability of your obfuscated email address –  Try this FREE online tool.

The aim here is to maintain an active HTML hyperlink which will open your email program and compose a new email.

So let’s get started!

1. How to hide or obfuscate an email hyperlink in WordPress using Javascript

2. Obfuscate your email address with WordPress built-in antispambot() function

3. Encode WordPress email links using javascript and ROT13