Encode your email links to prevent spam

One of the popular ways to hide your email on a web page from spam bots is to display the email as an image or to use the ‘[at]’ word instead of the ‘@’ sign. The code given here is yet another way to fight spam. The below function will let you to encode email or other links to their equivalent HTML entity encoded syntax. This will enable you to hide your web-page emails from spam bots. As the browser converts and displays the appropriate string from the encoding the user will be able to correctly see the email id, but a spam bot will have a difficult time to decode the encoded string. Of course we now have quite sophisticated crawlers that can work around this types of encoding, but for other crawlers that rely on regular expressions or other such simple methods, they will find it difficult to grab the email links from the page.
Read More