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>
If you liked this, please share it.

Tags: , , , , , , , , , , , , , , , , , , ,

Short URL: http://bit.ly/cuRBa2

Discussion 10 Comments

  1. David Holowiski on December 31, 2009 at 6:14 pm

    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.

    • c.bavota on January 11, 2010 at 11:17 am

      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.

  2. Virginia on January 9, 2010 at 11:57 am

    If I install this now, will it scramble the email links that have already appeared in my stories?

    • c.bavota on January 11, 2010 at 11:19 am

      Not really. You would have to do that manually.

  3. Jonathan Miller on January 9, 2010 at 7:56 pm

    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

    • c.bavota on January 11, 2010 at 11:18 am

      That is also a great way and with a tool like the one you suggested, super easy. Thanks.

  4. Tim Nicholson on March 8, 2010 at 7:32 pm

    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.

  5. mcas on May 22, 2010 at 4:59 am

    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…

  6. Nick Banford on June 11, 2010 at 4:31 am

    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.

    • c.bavota on June 11, 2010 at 12:10 pm

      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.

Leave a Reply

Your email address will not be published. Required fields are marked *

*


To enter code in the comment box, please place it between <pre lang="php"> </pre> tags. You don't have to convert any characters to their hex/HTML code. Just add your code the way you would to any code editor.