Click here to Skip to main content
15,892,697 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
I have a web service at www.mysite.com/SomePath/SomeService.asmx. When I search on google for "inurl:mysite.com", I get that web service as one of the results. I would like that web service to not show up in the search results.

I have tried adding a robots.txt file to exclude /SomePath/ from search results, but that hasn't seemed to work yet (though it's only been a day or two, so maybe it'll take more time). Also, I can't remove the "link" to this web service from all other crawled pages, because I'm pretty sure ASP.NET is including the link on any page that references the web service. I'm using this syntax to reference the web service:
ASP.NET
<asp:ServiceReference Path="~/SomePath/SomeService.asmx" InlineScript="true" />

I suspect setting InlineScript to true is causing the path to the web service to be output to the HTML, so my next step will be to try setting that property to false. However, I am not sure that will work and I would rather not set it to false, so if you have any other recommendations I would appreciate it.
Posted

Use a robot.txt file to your website and specify url which should not be listed by search engines using this block

VB
User-agent: *
Disallow: /SomePath/SomeService.asmx



For more details see the page

http://www.robotstxt.org/robotstxt.html[^]
 
Share this answer
 
Comments
AspDotNetDev 19-Sep-11 12:58pm    
Did you see the part of my question where I said "I have tried adding a robots.txt file to exclude /SomePath/ from search results"?
Use AjaxToolkit Control NoBot control
 
Share this answer
 
Comments
AspDotNetDev 19-Sep-11 12:57pm    
Uh... that prevents bots from posting garbage on your website, not web crawlers from indexing your web service.

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900