Protecting your email from spam bots and scrapers is essential. Learn proven techniques to display email addresses on websites while keeping them safe from automated harvesters.

Why Hide Email Addresses?

Spambots automatically crawl websites looking for email addresses. Once found, your email gets added to spam lists, resulting in:

  • Hundreds of spam emails daily
  • Phishing attempts and scams
  • Malware distribution
  • Database breaches and identity theft risks

Method 1: Use Contact Forms

The most effective solution—don't display email addresses at all.

Advantages:

  • 100% protection from scrapers
  • Can include CAPTCHA for bot protection
  • Collect additional information if needed
  • Professional appearance

Implementation:

<form action="/contact" method="post">
  <input type="text" name="name" placeholder="Your Name">
  <input type="email" name="email" placeholder="Your Email">
  <textarea name="message" placeholder="Message"></textarea>
  <button type="submit">Send Message</button>
</form>

Method 2: JavaScript Email Obfuscation

Hide the email in JavaScript that bots can't easily parse.

<span id="email"></span>

<script>
  const user = 'contact';
  const domain = 'moonmail.io';
  const email = user + '@' + domain;
  document.getElementById('email').innerHTML =
    '<a href="mailto:' + email + '">' + email + '</a>';
</script>

Method 3: CSS Display Trick

Use CSS to hide parts of the email from scrapers.

<style>
  .hide { display: none; }
</style>

<p>
  contact<span class="hide">REMOVE</span>@<span class="hide">THIS</span>moonmail.io
</p>

Method 4: Character Encoding

Encode email addresses using HTML entities.

<!-- [email protected] encoded -->
<a href="&#109;&#97;&#105;&#108;&#116;&#111;&#58;
&#99;&#111;&#110;&#116;&#97;&#99;&#116;&#64;
&#109;&#111;&#111;&#110;&#109;&#97;&#105;&#108;&#46;&#105;&#111;">
Contact Us
</a>

Method 5: Replace @ and Dots

Display email in human-readable but bot-confusing format.

Examples:

  • contact [at] moonmail [dot] io
  • contact(at)moonmail(dot)io
  • contact [@] moonmail [.] io

Method 6: Use Images

Display email as an image instead of text.

Pros:

  • Effective against basic scrapers
  • Easy to implement

Cons:

  • Not accessible to screen readers
  • Users can't copy-paste the email
  • OCR technology can read images

Method 7: CAPTCHA-Protected Email Reveal

Require users to complete CAPTCHA before showing email.

<button onclick="showEmail()">Reveal Email</button>
<div id="emailBox" style="display:none;">
  <!-- Include reCAPTCHA here -->
  <div class="g-recaptcha"></div>
</div>

Method 8: Use Email Forwarding Services

Display a temporary or alias email that forwards to your real address.

Services:

  • SimpleLogin
  • AnonAddy
  • ProtonMail aliases
  • Apple Hide My Email

Best Practices

Combine Multiple Methods

Layer protection for maximum security:

  • Use contact forms as primary method
  • Add JavaScript obfuscation for displayed emails
  • Include CAPTCHA protection

Keep Accessibility in Mind

  • Ensure screen readers can access contact information
  • Provide alternative contact methods
  • Use ARIA labels appropriately

Update Regularly

  • Monitor for spam increase
  • Change protection methods if compromised
  • Use temporary emails for public listings

What NOT to Do

  • Don't use mailto: links directly - Easily scraped by bots
  • Don't put emails in plain text - Instant target for scrapers
  • Don't rely solely on robots.txt - Malicious bots ignore it
  • Don't use the same email everywhere - Creates single point of failure

For Business Websites

If you must display an email for business purposes:

  • Use a dedicated support or info email
  • Implement aggressive spam filtering
  • Monitor for compromises
  • Have backup contact methods
  • Consider using business email services with built-in protection

Conclusion

The best protection is using contact forms instead of displaying emails. If you must show an email address, combine multiple obfuscation techniques and monitor for increased spam. Remember: convenience for users vs. protection from bots is always a tradeoff.

Protect Your Email Marketing

MoonMail includes built-in spam protection and email validation to keep your campaigns safe.

Learn More