views:

50

answers:

3

Hello,

I have in my site some links that are just used to display informative popups.

For example I have something like :

<a href="#" id="myLink">show more info</a>

And in my .js file I have something like :

$(document).ready(function() {
  $("#myLink).click(function() {
      displayPopup();
});
});

But google crawler or other crawler follow the link and tell me that it's a wrong link (it goes to my /usercontrol folder...)

How can I avoid crawler to follow this link ?

Should I put :

<a href="#" id="myLink" onclick="return false">show more info</a>

and keep my jquery as it is ?

Or put return false in Jquery click event ?

Or not use an anchor but a div instead ? is it gonna work in all browser in this case ?

Thanks for all

+4  A: 
<a href="#" id="myLink" rel="nofollow">show more info</a>
Darin Dimitrov
A: 

As it's not really a link, you can use a span tag instead, and style it to look like you want. It will work in any browser that has Javascript enabled, just as your current solution.

Guffa
A: 

As @Darin suggested, using the rel attribute with a value of nofollow is a good technique.

However, to prevent search engines from accessing or indexing parts of your site, you should use the Robots exclusion standard. See the interpretation of nofollow by various search engines.

To tell all user agents to not follow or index a given url, use a robots.txt file with the following contents:

User-agent: *
Disallow: /usercontrol/

Google and all other bots should respect the contents of your robots.txt file, and not index any links starting with the path /usercontrol/.

Anurag