protect email from spam bots

Protect Email from 1000+ Spam Bots

Protect Email from Harvesting with JavaScript Encoding

We all despise spam. It’s not just annoying, but it can also pose security threats. To tackle this, we’ve crafted a JavaScript script designed to shield you from potential spam. This tool transforms standard email addresses into a format that was, as of 2005, challenging for most spam-bots (robots programmed to collect email addresses) to decode.

Incorporating the encoded email addresses on your web pages instead of plain text can significantly reduce the amount of spam you receive. This JavaScript function to obfuscate your email address is user-friendly and can be easily integrated into your website.

function encode(inputText)
{
    var encodedText = "";
    for (var i = 0; i < inputText.length; i++) {
        encodedText += "&#" + inputText.charCodeAt(i) + ";";
    }
    return encodedText;
}

By using this function, you add an extra layer of protection to your email address, making it more challenging for automated spam bots to harvest it. Stay one step ahead and safeguard your inbox from unwanted emails.

If you have any question, feel free to contact me.

Share this
Send this to a friend