2024
- Link Obfuscation for Email and Phone Numbers in Astrojs
Spiders and automated programs often scan websites for email addresses and phone numbers to harvest for spam campaigns. Obfuscation scrambles the data, making it unreadable to these bots and significantly reducing the chances of receiving unwanted emails or calls. While obfuscation protects your information to some extend, it doesn’t prevent users from contacting you. The idea behind the implementation proposed in this article is to Base64-encode the sensitive data and reverse the characters. The result is assigned to a data attribute while the standard href attribute contains no sensitve data. A small Javascript script will load automatically and will decode the value of the data attribute once the element get into the viewport.