1

I'm trying to obfuscate the contact email address on my website. I'm wondering what the best way is to do that.

  1. some javascript way (not sure what is the best one ... http://hivelogic.com/enkoder/ this one looks easy, but not sure if its strong or not).
  2. having an image called like "90210.png" and it is an image of the email address.

If javascript, what are some good scripts to do this?

Thanks!

Ringo

Ringo Blancke
  • 2,444
  • 6
  • 30
  • 54
  • ANd if it is image, you are not going to allow people to copy and paste it? – epascarello Jan 04 '12 at 00:50
  • possible duplicate of [Good non-intrusive anti-spam email obfuscator?](http://stackoverflow.com/questions/699185/good-non-intrusive-anti-spam-email-obfuscator) – epascarello Jan 04 '12 at 00:52

3 Answers3

2

Write a proper contact form system, so that you never give out your email address unless you choose to reply to a contact.

Alternatively, you can write it backwards, then use JavaScript to flip it around:

var email = "moc.elpmaxe@ydobemos";
document.write(email.split("").reverse().join(""));
Niet the Dark Absol
  • 320,036
  • 81
  • 464
  • 592
0

The safest approach would be to not publish an email address, and instead provide a contact form.

Next safest would be an image, as you said, or any presentation method that is not plain text.

If you're determined to present text, you just have to make sure it doesn't match a regular expression looking for email adresses. So you could break it up with spaces, replace "@" with "(at)" and/or "." with "(dot)", etc. Of course, those methods will not stop someone who wants to spam you specifically, but neither will any javascript trick.

0

Somebody did a study for 1.5 years to test which various methods of email obfuscation worked the most effectively -- Perishable Press created a writeup on it.

It seems like one of the best methods was to ROT-13 an email address then decrypt it using Javascript (of course, not everybody has Javascript enabled, so this isn't a perfect solution).

I'd recommend using a contact form if possible though -- that way, your website still remains accessible to people with Javascript disabled.

Michael0x2a
  • 58,192
  • 30
  • 175
  • 224
  • thanks for the info - that post was very interesting by the way. I think we will eventually have a comment form, but for now we want to make it clear that we have 1 person willing to take their email/phone calls/etc... so we may take the ROT-13 route. – Ringo Blancke Jan 05 '12 at 19:51