Easiest Ways to Hide Email Address From Bots Crawlers

Whether you are a blogger (wordpress or any other platform) or just a casual writer who publish online stuff and like to show-up your email address to your readers then there is just one problem. Automatic bots can collect your address and that can be used to send you spam emails.

Spamming is a big hassle and most of the email services are fighting with it but if you pay little attention then you can save yourself from such automated collection of your email address.

Simplest Way to Hide email From Bots

The CSS way: CSS is the easiest way to accomplish this task than other javasript and server-side processing (like PHP, .Net) style.

So there will be 2 parts for this: One is CSS and the other is the element on which this CSS will going to apply.

Below is the CSS this you either need to paste under head tag or place it anywhere on your html page. It will get rendered.

CSS is:

<style> <!– START Hide method1’s b tag  –>
#email b {
display:none;
}
</style> <!– END Hide method1’s b tag  –>

HTML is:

<span id=”email”>user<b>stuffing</b>@<b>stuffing</b>domain.com</span>

Explanation: Although it’s self explanatory. #email is the id tag (used to find the element) which is followed by a b tag. So, wherever there is an HTML element with id=”email” and within that id a b tag (<b>sometext </b>) like in the above html, this CSS will be applied to it.

And the CSS says that it will not display (display:none) whatever is written between <b></b> tags. So what user see is the actual address i.e. user@domain.com and bot will see userstuffing@stuffingdomain.com. Mission accomplished!

Although there are many other ways to do hide email address from bots and I have tested them. But this is the best and easiest.

Benefits of using this method than other javascript or Css methods is:

  • It’s easy to implement and a one time addition of code into style.css file will benefit you throughout your site.
  • If you own a wordpress blog then again adding this little css is easy. So, no need of plugin overload.
  • User can copy and paste your email address like it’s being displayed. Other methods will stop you copying the real email address but the stuffed one.