1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

Best way to display an email address on a website without being spammed?

Discussion in 'White Hat SEO' started by ShadeDream, Jun 26, 2012.

  1. ShadeDream

    ShadeDream Elite Member

    Joined:
    Nov 27, 2008
    Messages:
    2,209
    Likes Received:
    5,230
    Location:
    He who laughs last, laughs longest.
    What is the best way to display a contact email address on a website without it being spammed by bots? I know that I can put the email address into a picture but that won't be user friendly. Is there any other way where the user will be able to copy and paste the email whereas a bot won't even see it? I could use a contact form but that sort of defeats the purpose.
     
    • Thanks Thanks x 1
  2. LukaB

    LukaB Jr. VIP Jr. VIP Premium Member

    Joined:
    Apr 3, 2010
    Messages:
    3,546
    Likes Received:
    4,246
    Gender:
    Male
    Location:
    Planet Earth
    email[at]site.com
     
  3. bryanon

    bryanon Executive VIP Premium Member

    Joined:
    Oct 16, 2009
    Messages:
    1,395
    Likes Received:
    1,479
    No. If you want your user to be able to copy-and-paste the e-mail address then their computer has to allow them to do this. Which in turn means that a computer can do it on its own as well.

    What Luka suggested above (writing [at] or (at) instead of @ and [dot] instead of . etc.) used to work fine and still works to a certain extent but as a lot of webmasters are already doing this, harvesters are becoming smarter as well, meaning that while doing it will certainly reduce the chances of getting spammed, it won't eliminate them.

    The only near-foolproof way is using images.
     
    • Thanks Thanks x 1
  4. Amsterdammer

    Amsterdammer Power Member

    Joined:
    Aug 9, 2011
    Messages:
    515
    Likes Received:
    563
    Actually, I found an email scrambler a while back. I have to admit I did not use it, but it seems to work.

    I have a file that generates the code for me, if you like you can have it.

    Anyways, for shadedream@blackhatworld.com you would have to put this code in the head:
    Code:
    <SCRIPT language="JavaScript">
    function  unScramble(eMail1,eMail2,linkText,subjectText,statusText){
    var  a,b,c,d,e;a=eMail1;c=linkText;b=eMail2.substring(0,eMail2.length-5);
    if(subjectText!=""){d="?subject="+escape(subjectText);}else{d="";}
    if(statusText!=""){e="  onMouseOver=\"top.status=\'"+statusText+ 
    "\'\;return true\;\"  onMouseOut=\"top.status=\'\'\;return  true\;\"";}else{e="";}
    document.write("<A  HREF=\"mai"+"lto:"+a+"@"+b+d+"\""+e+">"+c+"</A>");}
    </SCRIPT>  
    Where ever you need the email displayed you put this in:
    Code:
     <script language="JavaScript">unScramble("shadedream","blackhatworld.complete","Email me","Just a little note...","Click here to send me email");</script><noscript>Email me: shadedream/ÄT/blackhatworld/DÖT/-c-o-m-/</noscript>
    I hope this helps, if not please feel free to ignore as you see fit. :)

    P.S I did not check this actual code, I do know this thing works though as I tested it but had no need for it at the time.
     
    • Thanks Thanks x 2
    Last edited: Jun 26, 2012
  5. ShadeDream

    ShadeDream Elite Member

    Joined:
    Nov 27, 2008
    Messages:
    2,209
    Likes Received:
    5,230
    Location:
    He who laughs last, laughs longest.
    That doesn't look professional and it doesn't really work like it used to. :)

    Wouldn't bots still be able to read this?

    I think I may just stick to the image method.
     
  6. katkoute

    katkoute Regular Member

    Joined:
    Feb 22, 2012
    Messages:
    253
    Likes Received:
    118
    Occupation:
    Iming All Day
    Location:
    Morocco Mall
  7. Zapdos

    Zapdos Power Member

    Joined:
    Oct 22, 2011
    Messages:
    597
    Likes Received:
    708
    Location:
    Eastern North Carolina
    You could try something like this:
    Code:
    <span class="email">som</span><span class="img">emai</span><p id="plop">lhere</p><div class="breaker">@</div><div>yourwebsite</div><span class="enjoy">.com</div>
    Since bots work on the source and not what they see, that should be broken to the point of being unknown. For more obscurity you can even use PHP to randomize the classes/ids.
    Browsers will still highlight it without issue.
     
    • Thanks Thanks x 3
  8. dbyrn

    dbyrn Power Member

    Joined:
    Feb 20, 2010
    Messages:
    746
    Likes Received:
    224
    Occupation:
    helping people
    Yeah, obfuscating html like Zapdos has given or dynamic javascript (Amsterdammer) should work (I would vote for html, seems easier).
    I personally use pictures.

    D.
     
  9. Web Echo

    Web Echo Regular Member

    Joined:
    Apr 5, 2012
    Messages:
    327
    Likes Received:
    125
    Location:
    Online
    I am using :

    email @ THIS DOMAIN
     
    • Thanks Thanks x 1
  10. Amsterdammer

    Amsterdammer Power Member

    Joined:
    Aug 9, 2011
    Messages:
    515
    Likes Received:
    563
    I actually thought the same thing but found Zappo is absolutely right :"Since bots work on the source and not what they see, that should be broken to the point of being unknown".

    At first I wanted to reinvent the wheel and tackle this with php but found I am not educated enough.
    I wanted to create a button to tell the email address after clicking it, sort of like this but with a twist. Perhaps someone else can get it to work, I give up for now.
    So, I found a link that basically lists all ways to obfuscate. It is even suggested to use CSS since bots look at the source and not the end result, no clickable links with that though.

    That being said, I think bryanon is right in saying that if we can read it a bot can read it too.
    Then again, for a bot to be programmed there first needs to be a steady pattern. Since more people are using "amsterdammer AT blackhatworld dot com" it is useful to make bots for it.
    It's a bit harder to solve obfuscation via CSS I think.
    But in the end...

    Other than obfuscating there is putting bots in isolation. While I think a bot would use a proxy you might still identify it on behaviour and then feed it wrong information.
    Here is a quote from the link above.

    I just tried the code I provided you btw and the source code of the page when displayed doesn't show any email address so I think it should work as well as pictures, until too many people are using this particular obfuscation code of course. :p
    The added benefit is that it's clickable though.
    But, if you rather stick to pictures I totally understand after reading up on it.

    Anyways, this has been educational. Thank you for that. :)
     
    • Thanks Thanks x 1
  11. Zapdos

    Zapdos Power Member

    Joined:
    Oct 22, 2011
    Messages:
    597
    Likes Received:
    708
    Location:
    Eastern North Carolina
    It can be hidden and when a link is clicked it is displayed via ajax. You could also just put it on an ajax timer (instant) to load from a web page. Bots generally don't "run" javascript either as it takes up alot more time and power. Can be done in about 5-10 mins using jquery.
     
    • Thanks Thanks x 1
  12. williamk

    williamk BANNED BANNED

    Joined:
    Oct 29, 2009
    Messages:
    1,030
    Likes Received:
    184
    Make a image JPG file with mspaint and use that.
     
  13. n0de32

    n0de32 Junior Member

    Joined:
    Jan 25, 2010
    Messages:
    193
    Likes Received:
    225
    Occupation:
    IM Scientist
    Location:
    Earth. Mostly.
    • Thanks Thanks x 1
  14. poweronics

    poweronics Jr. VIP Jr. VIP Premium Member

    Joined:
    May 1, 2011
    Messages:
    3,117
    Likes Received:
    353
    Occupation:
    Freelancer
    Home Page:
    That seems quite valid to me.
     
  15. HP.Bryce

    HP.Bryce Registered Member

    Joined:
    Jan 9, 2012
    Messages:
    53
    Likes Received:
    7
    Occupation:
    Marketing Intelligence Manager
    Location:
    Manila, Philippines
    Amsterdammer, I am in the process of remaking the corporate web site and this will be perfect for the anticipated Bio section. I wanted to avoid the image files as well. Although if I stuck with images I would have another Alt "" to use. Why is it always 6 of one kind and a half dozen of another?
     
  16. Pilot

    Pilot Junior Member

    Joined:
    Jan 24, 2012
    Messages:
    153
    Likes Received:
    29
    Location:
    New York City
    Actually, I can't see why putting your email address into an image wouldn't be user friendly as long as it's done in the right way. Plenty of people do it and having tons of brackets and spaces seems much less user friendly than an image.
     
  17. Zapdos

    Zapdos Power Member

    Joined:
    Oct 22, 2011
    Messages:
    597
    Likes Received:
    708
    Location:
    Eastern North Carolina
    images are not user friendly or productive. They have to type it in manually. Everything. You would be amazed with how many people don't get it right.

    If you use images to show emails, you're not getting them all.
     
    • Thanks Thanks x 1
  18. ShadeDream

    ShadeDream Elite Member

    Joined:
    Nov 27, 2008
    Messages:
    2,209
    Likes Received:
    5,230
    Location:
    He who laughs last, laughs longest.
    Yes it definitely has, thank you for your input. Javascript obfuscation seems to be the best way while at the same time keeping it user friendly. Though, if bots can read JavaScript they will just be able to unscramble the email using the JS and I believe some do. When it comes to SEO, how does Google perceive such sites? It would seem that using an image may be a lot safer than placing obfuscated JS on a web page. I've not heard of CSS obfuscation and I don't really know how this would work, I guess I will need to do some research.

    Edit: I just found two, quite interesting articles that pretty much give the same/similar solution in a slightly different way (haven't fully read them yet):

    Code:
    http://www.html-advisor.com/javascript/hide-email-with-javascript-jquery/
    http://stackoverflow.com/questions/7489640/hiding-email-address-with-jquery
     
    Last edited: Jun 28, 2012
  19. Zapdos

    Zapdos Power Member

    Joined:
    Oct 22, 2011
    Messages:
    597
    Likes Received:
    708
    Location:
    Eastern North Carolina
    Bots can execute javascript but as previously stated, most don't because of complexity, bandwith or speed. Using javascript is still a very viable strategy.

    Using jquery you can do something like this:
    Code:
    <span class="email">ilikefakemeat@yourdomain.com</span>
    <script type="text/javascript">
    var p1 = 'some';
    var p2 = 'email';
    var p3 = '@';
    par p4 = 'yourdomain.com';
    $(document).ready(function() {
      $('.email').html('').append(p1 + p2 + p3 + p4);
    });
    </script>
    
    That sets up the default email spam bots see to ilikefakemeat@yourdomain.com while when the page loads jquery while remove it and then adds the real one.
     
    • Thanks Thanks x 2
  20. umerjutt00

    umerjutt00 Jr. VIP Jr. VIP Premium Member

    Joined:
    Oct 28, 2011
    Messages:
    3,644
    Likes Received:
    1,904
    Occupation:
    Ninja
    Adding a contact form will serve the cause. You can also add a picture displaying your email address. What you think about writing the email like me[@]mail dot com