Protect your email addresses from spam

Your ads will be inserted here by

Easy Plugin for AdSense.

Please go to the plugin admin page to
Paste your ad code OR
Suppress this ad slot.

Before you publish your email addresses somewhere on your webpage, blog or personal site, you should think about protecting it from spammers respectively from bots crawling the net looking for email addresses.

There are several methods to accomplish this. I’ll list a few of those methods:

Antispam

Convert the email address to Unicode characters

This was not a bad idea in the past, but also bots evolve  It can just as easily interpret the special character entities #64;, #46; for the @ and the . characters respectively. A minor plus in this case is that, the user may be able to use their email client.


HTTP redirection

Write a server-side script to return "mailto:foo@host.com" link as an HTTP redirect. All modern browsers recognise this, but perhaps not many harvester bots do. This can be done with Apache’s mod_rewrite, Javascript or server-side scripting. Here is an example in PHP:

/* Will be displayed in browser like*/

foo’s email

/* In email_foo.php file */

header ("Location: mailto:foo@host.com");

exit();

?>

In this case the user has to follow the link and rely on their mail application to get a hold of the email address. The user has to copy the email address from the application instead of doing it directly from the webpage.


Using a JavaScript (my favorite)


/* Will be displayed in browser like*/

contact foo via mail

—- script —

— end of script—

however, there are several good methods, it’s almost impossible to list them all .. if you’re interested in protecting your email address using other ways, here are a few keywords to use when searching in Goggle or Bing..

Hex values

HTML Comments

Fake email

Obfuscate AJAX

CSS pseudo-element

Images

CSS unicode-bidi

CSS display be none

Flash

Forms


Links

Methods to hide email addresses from page source

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.