Build a robots.txt without accidentally hiding the whole site.
Ignored by Google. Honoured by some other crawlers.
robots.txt with 3 disallow rules
robots.txt controls crawling, not indexing, and the difference matters more than it sounds. A page blocked here can still appear in results if other sites link to it, because the crawler is told not to fetch it but is not told to forget it exists. To keep a page out of the index, let it be crawled and serve a noindex directive. Blocking it here actually prevents that directive from ever being seen. The file must sit at the root of the domain, applies only to that host and scheme, and is a public document that anyone can read.
User-agent: * Disallow: /admin/ Disallow: /cart/ Disallow: /search
What this cannot tell you
Take this with you
robots.txt Generator on RunTheTests — free browser-based seo tools, no sign-up.