Forum Moderators: open

Message Too Old, No Replies

A way to keep spider from following link?

         

FunnyGirl

8:56 pm on Feb 5, 2003 (gmt 0)

10+ Year Member



I have a link every now and then that I don't want spidered. I think it can be done with java but I'm not sure how to do it. Can someone help with this?

DrDoc

9:09 pm on Feb 5, 2003 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



There are two ways to accomplish this:

First, put the following in your robots.txt file:

User-agent: *
Disallow: /path_to_your_file/filename.html

You can also put the following in the file in question:

<meta name="ROBOTS" content="NONE">

FunnyGirl

9:17 pm on Feb 5, 2003 (gmt 0)

10+ Year Member



Thanks,
DrDoc

tedster

9:54 pm on Feb 5, 2003 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



I think it can be done with java but I'm not sure how to do it.

I'm pretty sure you mean javascript, not java (these are two VERY different technologies).

What DrDoc gave is probably the best solution, because it won't make a problem for your visitors who have disabled javascript in their browser. And well-behaved spiders will listen to those instructions -- however, not all spiders are well-behaved.

So, if you want to use javascript to be sure that rogue spiders don't follow the links:

<a href="#" onClick="location='page.html'">link</a>