Dec
29
2009
A Clever and Safe Way to Display your Email Address
There are many reason why you shouldn’t place your email address on a Web page; the number one being spambots. There are tons a spambots running around the Web looking for that “@” symbol so that they can bombard you with as much spam as possible. Instead of displaying my email address, I use a contact form. Lately though, I have been reading about many reasons why you should display your email address so that it is easier for visitors to contact you.
Here is a clever and safe way to display your email address using CSS redirection.
First we need to create a style in your header or in your stylesheet:
<style type="text/css"> span.redirect { unicode-bidi:bidi-override; direction: rtl; } </style> |
Now all you need to do is write your email address backwards and use the style like this:
<span class="redirect">moc.liamg@emanruoy</span> |
That’s a nice piece of code, but since it would only take a line or two of code to decode that, don’t you think the spambots will be able to decode that too?
I personally prefer contact forms because I think most people have webmail accounts now, so if they click on a email link it just tries to launch a non-existent email client.
So far I haven’t had any spam in the testing environment I created using the above code. But you are correct in thinking that someday soon they might figure out a way to even spam email addresses that use this trick.
If I install this now, will it scramble the email links that have already appeared in my stories?
Not really. You would have to do that manually.
The method I use to display my email without fear of being spammed is to encode my address with ascii character entities. The regular user (read: human) will just see a regular email address that they can copy and paste into their mail client. The spambots will pass right over it without even noticing it.
An easy way to encode your email addresses this way is through this website: http://www.wbwip.com/wbw/emailencoder.html
That is also a great way and with a tool like the one you suggested, super easy. Thanks.
In addition, if you are displaying emails through WordPress code itself, such as automatically displaying author information on a post, you can use the built-in WP function antispambot() http://codex.wordpress.org/Protection_From_Harvesters. This does the same thing as the ascii encoder mentioned above.
Honestly, 99.9% of spam to my work email address, which is all over my non-profit website– and gets auto-forwarded to (firstname).(org)@gmail.com gets caught by gmail’s standard– it’s just really not that big of a problem, honestly, and my email is all over the internet…
Copy and pasting the address gives the string in it’s original (backwards) form which would frustrate users. Is there a way to get round that? Otherwise I can’t use this method.
There’s no way around it. All in all, I really suggest no having your email displayed and using a contact form but if you do display your email you need to somehow secure it.