robots.txt Disallow All: What It Blocks and What It Does Not

Two lines, User-agent: * followed by Disallow: /, ask every polite crawler to stop fetching any page on that host. They do not remove pages from search: Google says a blocked address can still be listed without a description when other sites link to it. To keep pages out, use noindex or a password.

Ways to keep crawlers or searchers away, compared
MethodStops crawlingKeeps the page out of results
robots.txt Disallow: /Yes, for crawlers that obey itNo, the bare address can still appear
noindex meta tag or X-Robots-Tag headerNo, the page must stay crawlableYes, once Google recrawls it
Password or loginYes, crawlers get no contentYes
noindex line inside robots.txtNoNo, Google does not support it

Updated

robots.txt is a plain text file at the root of your domain that tells crawlers, the programs search engines send to read pages, which paths they may fetch. A disallow all file is common on staging copies and new sites, and it is also the line most often left behind by accident at launch. Test your own rules in the matcher below.

Disallow all matcher

Your robots.txt

User-agent: *
Disallow: /
Allow: /public/

User-agent: Bingbot
Crawl-delay: 5
Disallow: /cart/

Crawler name: Googlebot

Path to test: /public/menu.pdf

Result

Allowed: /public/menu.pdf may be crawled.

Group used: User-agent: * (no group names this crawler).

Deciding line 3: Allow: /public/

Runs in your browser on the text you paste, following RFC 9309. Nothing is fetched or uploaded.

Copyable recipes

Each file below goes at the root of one host, for example https://staging.example.com/robots.txt.

Block every crawler from every path

The classic staging file. Remove it before launch.

User-agent: *
Disallow: /

Allow everything

An empty Disallow value blocks nothing. Add your sitemap address so crawlers find every page.

User-agent: *
Disallow:

Sitemap: https://www.example.com/sitemap.xml

Block everyone except one folder

The longer Allow path beats the one-character Disallow path.

User-agent: *
Disallow: /
Allow: /press/

Keep a page out of results instead

Leave the page crawlable and add this tag to its head. The response header form works for PDFs and images.

<meta name="robots" content="noindex">

<!-- or as an HTTP response header -->
X-Robots-Tag: noindex

How a crawler reads your rules

First the crawler picks a group. It looks for a User-agent line that names it, and only when none matches does it fall back to the group headed User-agent: *. Then, within that group, the rule with the longest matching path wins. When an allow rule and a disallow rule are equally long, RFC 9309 says the allow rule should be used.

That is why Disallow: / plus Allow: /public/ still opens the public folder: the allow path is longer, so it is more specific.

Staging and pre-launch sites

A development copy at a staging address can end up in search if anyone links to it. A login or HTTP authentication stops both crawling and indexing. If you can only use robots.txt, pair it with care at launch: delete the block, then request indexing of the home page in Search Console.

If staging pages already appear in results, remove the robots.txt block for a while so Google can crawl them and see a noindex tag, or protect them with a password.

How it works

  1. Paste the full contents of your robots.txt into the matcher.
  2. Type a crawler name, such as Googlebot or Bingbot, and a path that starts with a slash.
  3. Read which group of rules applied and which line decided the result.
  4. Change a rule and watch the verdict update, then copy the fixed file back to your server.

Tips

Frequently asked questions

Does Disallow: / remove my site from Google?

No. It stops Googlebot from reading pages, but Google's documentation says a disallowed URL may still be indexed and shown without a snippet. To drop pages from results, let Google crawl them and serve noindex instead.

Can I put noindex in robots.txt?

Google's block-indexing page states that a noindex rule in the robots.txt file is not supported. Put noindex in a robots meta tag in the page head, or in an X-Robots-Tag response header for files like PDFs.

Does Google obey Crawl-delay?

No. Google's robots.txt specification lists user-agent, allow, disallow and sitemap as the fields it reads and names crawl-delay as unsupported. Bing's webmaster blog says Bingbot does honour Crawl-delay, with a window from one to thirty seconds.

What if robots.txt returns a server error?

RFC 9309 says a crawler must assume complete disallow when the file is unreachable because of a server error. Google stops crawling for the first 12 hours and then falls back to its last good copy, so a broken file can pause crawling.

How quickly does a change to robots.txt take effect?

Google generally caches the file for up to 24 hours, and RFC 9309 says crawlers should not use a cached copy longer than that. Expect up to a day before a removed block is noticed.

Related: robots.txt tester, robots.txt generator, Sitemap and robots.txt examples, WordPress robots.txt, Google Search Console guide.

Start for free or see all free tools. We.Inc is free to start, with no card needed. AI building is on paid plans from $20 a month.

More in Guides

We.Inc is an AI-powered website builder you can resell under your own brand. Launch a branded client dashboard, bill on Stripe Connect, and deliver AI-generated websites in minutes. White-label plans start at $99 a month for 25 client sites, with a 7-day free trial and no per-site fees.

Product

Who It's For

Features

Resources

Company

View Sitemap