Correct way to link methods that Crawlers don't follow

Discussion in 'Web Design and Development' started by jared_kipe, Jan 10, 2011.

  1. jared_kipe macrumors 68030

    jared_kipe

    Joined:
    Dec 8, 2003
    Location:
    Seattle
    #1
    I recently redesigned my gallery software, and in doing so I created some links that do things like flag or rank pictures. If you don't have javascript enabled they will still function, albeit in a somewhat weird way.

    With javascript enabled, I intercept the click events and use ajax to get the results back.

    The problem I had was that web crawlers like google are now "clicking" the links and voting on things unknowingly.

    I've thought of a couple of ways to prevent this from happening but was wondering what the general consensus is on the matter.

    1) abandon non-JS browsers and move the href portion of the link into the javascript.
    2) have the server side code check the user's agent type and simply not do anything for some user agents.
    3) abandon the current link paradigm for a button one.

    I have some other questions, but I'm gonna start with this one as it may change the other questions. Thanks in advance.
     
  2. ChicoWeb macrumors 65816

    ChicoWeb

    Joined:
    Aug 16, 2004
    Location:
    California
    #2
    Did you try putting a rel="nofollow" in your a tag?
     
  3. jared_kipe thread starter macrumors 68030

    jared_kipe

    Joined:
    Dec 8, 2003
    Location:
    Seattle
    #3
    That was another idea I had, but after reading about it I discarded it.

    The reason is that according to wikipedia, search engine crawlers will still follow the link, they just don't index the page.

    In fact, rel="nofollow" is explicitly stated as NOT being to block access to or prevent content from being indexed.
     
  4. angelwatt Moderator emeritus

    angelwatt

    Joined:
    Aug 16, 2005
    Location:
    USA
    #4
  5. jared_kipe thread starter macrumors 68030

    jared_kipe

    Joined:
    Dec 8, 2003
    Location:
    Seattle
    #5
    Shouldn't help, because I want search sites to index the page, just don't want them to click certain "button" like links.

    After looking at hulu.com's buttons I decided to emulate them. I replaced all the old href's with id= and made the href="#" for the links. Obviously I changed my javascript appropriately to pull the id instead of the href as the url.

    So this sacrifices users with javascript turned off, but it isn't a huge deal.
     
  6. angelwatt Moderator emeritus

    angelwatt

    Joined:
    Aug 16, 2005
    Location:
    USA
    #6
    You don't add the pages the the links are on, just the links that you don't want them to initiate.
     

Share This Page