Skip to content
Back to all articles
SEO5 min readSeptember 30, 2026

7 robots.txt Mistakes That Quietly Block Google

The robots.txt errors that knock sites out of search, how Google actually reads your rules, and how to test every change before it goes live.

7 robots.txt Mistakes That Quietly Block Google article
In this guide
  1. What robots.txt does, and what it does not
  2. How crawlers read the rules
  3. Mistake 1: Disallow everything, left over from staging
  4. Mistake 2: A specific group that silently replaces the general rules
  5. Mistake 3: Blocking CSS and JavaScript
  6. Mistake 4: Wildcards that match far more than intended
  7. Mistake 5: Case and trailing slashes
  8. Mistake 6: Using robots.txt to remove pages from Google
  9. Mistake 7: The file is in the wrong place
  10. Testing changes before they go live
  11. A sensible starting file
  12. What about AI crawlers?
  13. Beyond robots.txt

A robots.txt file is usually a few lines long, often forgotten, and capable of wiping a website out of Google almost overnight. It happens more often than you would think: a new site launches, traffic never arrives, and weeks later someone discovers a single line left over from the staging server telling every search engine to stay away.

The frustrating part is that nothing looks broken. The site loads, the pages look fine, and there is no error message. This guide covers how crawlers actually read robots.txt, the seven mistakes that cause the most damage, and how to test changes safely before they go live.

What robots.txt does, and what it does not

robots.txt is a plain text file at the root of your site, such as https://www.example.com/robots.txt. It tells well-behaved crawlers, like Googlebot and Bingbot, which parts of the site they may request.

Two things it does not do:

  • It does not hide pages. A blocked URL can still appear in search results if other sites link to it, just without a description.
  • It does not protect anything. The file is public, and bad bots ignore it. Private areas need passwords, not robots.txt.

How crawlers read the rules

Understanding the matching logic prevents most mistakes. A robots.txt file is made of groups, each starting with one or more User-agent lines, followed by Allow and Disallow rules.

text
User-agent: *
Disallow: /admin/
Allow: /admin/help/

User-agent: Googlebot
Disallow: /drafts/

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

Google follows these steps, as documented in the robots.txt standard (RFC 9309):

  1. Pick one group. A crawler uses the most specific group that names it. Googlebot uses the Googlebot group above and ignores the * group completely.
  2. Find matching rules. Within that group, every Allow and Disallow rule whose path matches the start of the URL is considered.
  3. The longest match wins. The most specific (longest) matching rule decides. If an Allow and a Disallow are equally long, Allow wins.
  4. Wildcards. * matches any characters, and $ marks the end of the URL.

Mistake 1: Disallow everything, left over from staging

text
User-agent: *
Disallow: /

This blocks the entire site. It is correct on a staging server and a disaster on the live one. It often survives a launch because the file is copied along with everything else.

Check: test the homepage path / for Googlebot right after every launch or migration.

Mistake 2: A specific group that silently replaces the general rules

You carefully block /checkout/ and /account/ in the * group, then add a group for Googlebot to block one extra folder. Because Googlebot now has its own group, it ignores every rule in *, including the ones you cared about.

Fix: copy the shared rules into every named group, or avoid named groups unless you really need them.

Mistake 3: Blocking CSS and JavaScript

Rules like Disallow: /wp-includes/ or Disallow: /assets/ were common advice years ago. Today Google renders pages like a browser. If it cannot load your stylesheets and scripts, it may see a broken layout and misjudge the page, especially on mobile.

Fix: allow the files needed to render your pages.

Mistake 4: Wildcards that match far more than intended

Disallow: /*? blocks every URL with a query string, which may include pagination, search results you want indexed, or tracking parameters on important landing pages. Disallow: /*.pdf blocks PDFs, but also any path that merely contains .pdf somewhere.

Fix: be precise. Use $ to anchor file types, such as Disallow: /*.pdf$, and test real URLs before publishing.

Mistake 5: Case and trailing slashes

Paths are case-sensitive. Disallow: /Admin/ does not block /admin/. And Disallow: /blog blocks /blog, /blog/, /blog-news and /blogroll, because it matches anything that starts with those characters.

Fix: match the exact case in your URLs, and add a trailing slash when you mean a folder only.

Mistake 6: Using robots.txt to remove pages from Google

Blocking a page does not remove it from the index. Worse, if a page is blocked, Google cannot see a noindex tag on it, so the page may stay listed.

Fix: to remove a page, allow crawling and add a noindex robots meta tag, or protect it with a password. Once it has dropped out of search, you can block it if you wish.

Mistake 7: The file is in the wrong place

robots.txt only works at the root of the host. A file at /blog/robots.txt is ignored. Each subdomain, such as shop.example.com, needs its own file. And if your site redirects between versions (HTTP to HTTPS, non-www to www), make sure the final version serves the file; the Redirect Checker shows exactly where /robots.txt ends up.

Testing changes before they go live

Because a single character can change what is blocked, never edit robots.txt directly on a live site without testing. The Robots.txt Tester lets you paste your file, choose a crawler such as Googlebot or *, and test any path or full URL. It applies the same group selection and longest-match rules described above, supports * and $ wildcards, and shows the exact rule that decided the result. Because it uses the text you paste, you can try a draft before uploading it.

A good testing routine:

  1. Test your homepage.
  2. Test one page from every important template: product, category, article, contact.
  3. Test the URLs you intend to block, to confirm they really are blocked.
  4. Test a CSS and a JavaScript file from your theme.

A sensible starting file

For many small sites, this is all that is needed:

text
User-agent: *
Disallow: /admin/
Disallow: /cart/
Disallow: /checkout/

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

Block only areas with no value in search, such as admin screens, carts and internal search results, and list your sitemap so crawlers find every page you want indexed. If you are starting from scratch, the Robots.txt Generator builds a clean file from a few choices.

What about AI crawlers?

Many site owners now want to decide whether AI companies may use their content. Several AI crawlers identify themselves with their own user-agent names and say they respect robots.txt, for example GPTBot (OpenAI), ClaudeBot (Anthropic) and CCBot (Common Crawl). Google uses a separate token, Google-Extended, to control whether content is used for its AI models, without affecting normal search crawling.

text
User-agent: GPTBot
Disallow: /

User-agent: Google-Extended
Disallow: /

Two cautions. Blocking Google-Extended does not remove you from Google Search, but blocking Googlebot would, so double-check the names. And remember Mistake 2: adding these groups does not change the rules for other crawlers, but it is worth testing your main pages for Googlebot afterwards anyway.

Beyond robots.txt

A healthy robots.txt is one part of technical SEO. If your pages are crawlable but still not showing rich results, our guide to structured data for beginners is the natural next step, and if you have recently moved URLs, our guide to 301 vs 302 redirects helps make sure crawlers reach the right pages.

The most important habit, though, is simple: after every launch, migration or theme change, open your robots.txt and test the homepage. It takes one minute, and it catches the mistake that costs the most.

Was this article helpful?

Found this guide useful?

Share it with someone who is struggling with the same problem.

Free tool · No sign-up

Robots.txt Tester & Validator

Test whether a URL is allowed or blocked for Googlebot, Bingbot or any crawler, using Google’s robots.txt matching rules including * and $.

Open tool
Toolyconvert Team profile photo

Written by

Toolyconvert Team

Web Development & Software Engineering Team

The Toolyconvert Team builds, maintains, and improves free online tools designed to make everyday digital tasks faster and easier. Our team works across web development, software engineering, APIs, performance optimization, testing, and user experience to create reliable and practical tools.