// LEARN / CRAWL

Robots.txt best practices for crawl control

**If Google is wasting crawl on the wrong URLs, robots.txt is usually the first file to inspect.** On enzymes.bio, `16,100` pages are indexed while `591,000` are not, so every directive needs to be intentional.

Infographic showing Google crawl budget by HTTP status, with bar and pie charts

Why robots.txt still matters

On enzymes.bio, Google Search Console shows 7,950 organic clicks/month in May 2026, up from 2,770 in May 2025, with 557,000 impressions and only 1.4% CTR. The site also has 16,100 indexed pages, 591,000 not indexed, and 0 external backlinks. That makes crawl control a real rate-limiter, not a theory.

robots.txt does not index pages. It tells bots where not to spend fetches. That matters when a site has faceted URLs, translated paths, parameter junk, staging leftovers, or duplicate product variants. It also matters when the server starts returning 429 or 5xx, because crawlers then waste retries instead of discovering useful URLs.

For SEO, the file is a routing layer. Use it to keep bots away from low-value or risky paths, then confirm the result in Performance › Search results, Indexing › Pages, Settings › Crawl stats, and Links › External links. If the crawl graph is bad, the file is often one of the first fixes.

How robots.txt syntax works

User-agent targeting

Match a crawler by name, then apply rules under that block. User-agent: * is the catch-all. Specific bots override generic rules when both match.

Allow and disallow

Disallow blocks path prefixes. Allow opens exceptions inside blocked paths. Order matters less than match length, so the more specific path usually wins.

Sitemap references

A Sitemap: line can point crawlers at your XML file. Keep the URL absolute and return 200, not a redirect chain. Pair this with XML sitemap best practices.

Wildcard matching

Google supports and $. Use them carefully. Disallow: /? blocks parameter URLs, while $ anchors the end of a path. This is useful for robots.txt wildcard cleanup.

No crawl-delay in Google

Google ignores Crawl-delay. Some other bots may read it, but do not rely on it for crawl budget. If you need fewer fetches, block wasteful paths or fix server speed.

Diagram showing robots.txt crawl paths, allow and disallow rules, and index coverage metrics

Disallow vs noindex

Disallow and noindex solve different problems. Disallow stops crawling. noindex asks the bot to crawl, see the directive, then drop the page from index.

If a page is already blocked in robots.txt, Google cannot usually fetch its noindex tag. That is the classic mistake behind accidental index bloat. People block disallow vs noindex in the wrong order, then wonder why thin pages stay visible.

Use this rule set:

  1. Block crawling with robots.txt when the URL has no SEO value and does not need indexing.
  2. Use noindex when the URL must be crawlable but should not rank.
  3. Use canonical tags when duplicates should consolidate signals.
  4. Never block the only canonical path if you expect Google to evaluate it.
If you need help separating blocked URLs from indexing bugs, start with blocked-by-robots.txt fixes and then cross-check indexing issues troubleshooting.

What each directive does

DirectiveStops crawl?Stops index?

robots.txt Disallow

Yes, for matching paths

Not reliably by itself

noindex meta tag

No

Yes, after crawl

Canonical tag

No

Indirectly, by consolidation

X-Robots-Tag: noindex

No

Yes, after crawl

401 / 403 response

Usually yes

Usually yes

404 / 410 response

Yes, once processed

Yes, after removal

Rules that break sites

  1. 01

    Do not block CSS or JS

    If Google cannot fetch rendering assets, it may misread page content or layout. Check Indexing › Pages for rendering-related issues before you lock down /assets/, /static/, or theme bundles.

  2. 02

    Do not block canonical pages

    A blocked canonical URL can still exist in search as a stale or URL-only result. If the page should rank, let Google crawl it and validate the final status code is 200, not 302 or 404.

  3. 03

    Do not use robots.txt for removals

    If a product is gone forever, return 410 or 404. If it is temporary, use noindex or a short-lived 302. robots.txt only hides the crawl path; it does not clean index state.

  4. 04

    Do not blanket-block parameters

    Some query strings are useful for sorting or tracking; others create crawl waste. Block only the ones that generate duplicate pages. Compare Settings › Crawl stats before and after changes.

  5. 05

    Do not ignore redirect chains

    A 301 should point to the final target, not another 302. Crawlers can still waste budget on chains. Keep the robots file at a single stable URL: /robots.txt.

Crawl budget and logs

Crawl budget is not just size. It is the mix of demand, freshness, host capacity, and wasted fetches. If Googlebot spends time on blocked filters, duplicated language variants, or endless parameter URLs, discovery slows down.

That is why Settings › Crawl stats matters. Watch fetch volume, response time, and file type splits. Then compare against server logs. If logs show repeated hits to 404, 410, 429, or 5xx endpoints, the bottleneck may be server quality, not the robots file itself.

On enzymes.bio, the crawl problem is amplified by 35 languages via TranslatePress. A multilingual setup can create many near-duplicate URLs, which can inflate the not-indexed bucket fast. If your crawl graph looks like that, pair robots cleanup with stronger canonicals and sitemap hygiene. The file supports crawl budget optimization, but it does not replace it. See crawl budget optimization.

Example robots file

User-agent: *
Disallow: /cart/
Disallow: /checkout/
Disallow: /search/
Disallow: /*?sort=
Disallow: /*?filter=
Allow: /search/public/
Sitemap: https://example.com/sitemap.xml

User-agent: GPTBot
Disallow: /

User-agent: ia_archiver
Disallow: /

# Keep this file at https://example.com/robots.txt
# Return 200, not 301/302, for the final robots.txt URL

Cloudflare worker pattern

export default {
  async fetch(request) {
    const url = new URL(request.url);

    if (url.pathname === "/robots.txt") {
      return new Response(
        `User-agent: *\nDisallow: /private/\nSitemap: https://example.com/sitemap.xml\n`,
        {
          headers: {
            "content-type": "text/plain; charset=utf-8",
            "cache-control": "max-age=3600"
          }
        }
      );
    }

    return fetch(request);
  }
};

Check robots at the edge

curl -I https://example.com/robots.txt
curl https://example.com/robots.txt

# Confirm status, cache, and redirects
curl -s -D - https://example.com/robots.txt -o /dev/null

# Inspect whether the file is returning 200, not 301/302
# and whether the sitemap line points to a live XML file.
Hand-drawn diagram explaining six robots.txt rules with example allow and disallow paths

Fix blocked URLs safely

When a URL is blocked by robots.txt, first ask whether it should exist at all. If yes, remove the block and test the response code. If no, return 404 or 410, then let Google recrawl it.

Use Indexing › Pages to find patterns. If the issue is category filters, product variants, or translated pages, adjust the file with a narrow rule instead of a broad directory block. If the issue is a broken deploy, check whether the file changed during the release and whether the server returned 200 for the wrong content.

The cleanest workflow is:

  1. Confirm the URL in GSC.
  2. Inspect the live response with DevTools or curl.
  3. Check robots syntax and wildcards.
  4. Verify canonicals, noindex, and internal links.
  5. Re-test after Google recrawls.
If the problem is wider than one file, that is usually audit territory. Use technical SEO audit to map the crawl surface before the next deploy.

Six robots rules to keep

Keep it simple

Most sites only need a few Disallow lines, one Sitemap: line, and maybe a bot-specific block. If the file looks like a firewall policy, it is probably too complex.

Use exact paths

Block /checkout/, not /check. Block /tag/ if that is the duplicate source. Broad prefixes can kill important pages by accident.

Validate with live fetches

Test the served file, not the CMS draft. A typo in production can sit unnoticed while Google keeps fetching the wrong version.

Align with sitemap coverage

Only URLs you want indexed should appear in XML sitemaps. If a URL is blocked and still listed, that is a signal mismatch.

Watch international paths

With 35 languages, translated folders can create a lot of near-duplicate URLs. Robots can reduce waste, but hreflang and canonicals still carry the indexing logic.

Review after every deploy

A header rule, CDN rewrite, or CMS plugin can change the served file without changing the code repo. Re-check after release and after cache purge.

FAQ

What is the best robots.txt setup for SEO?

Keep it minimal: block only low-value crawl traps, expose one sitemap, and leave indexable pages crawlable. For most sites, the best setup is a small file that changes rarely and is always tested at /robots.txt.

Should I use robots.txt or noindex?

Use robots.txt to stop crawling, and noindex to stop indexing after a crawl. If you need Google to see the directive, do not block the page first.

Does robots.txt improve crawl budget?

Yes, when it removes junk URLs from the crawl path. It does not fix slow servers, broken internal links, or endless parameter generation. Pair it with logs and Settings › Crawl stats.

Can robots.txt deindex a page?

Not by itself. A blocked page may stay indexed if Google already knows it. To remove it, use noindex, 404, or 410, then let Google process the change.

What is the safest robots.txt wildcard pattern?

Use the smallest pattern that matches the problem. Disallow: /*?sort= is safer than blocking all query strings. Test every wildcard against real URLs before shipping.

Why does Google ignore crawl-delay?

Google does not use Crawl-delay as a control signal. If crawl volume is too high, reduce wasteful URLs or improve server response instead of depending on that directive.

// FAQ

Common questions

What is the best robots.txt setup for SEO?
Keep it minimal: block only low-value crawl traps, expose one sitemap, and leave indexable pages crawlable. For most sites, the best setup is a small file that changes rarely and is always tested at `/robots.txt`.
Should I use robots.txt or noindex?
Use robots.txt to stop crawling, and `noindex` to stop indexing after a crawl. If you need Google to see the directive, do not block the page first.
Does robots.txt improve crawl budget?
Yes, when it removes junk URLs from the crawl path. It does not fix slow servers, broken internal links, or endless parameter generation. Pair it with logs and `Settings › Crawl stats`.
Can robots.txt deindex a page?
Not by itself. A blocked page may stay indexed if Google already knows it. To remove it, use `noindex`, `404`, or `410`, then let Google process the change.
What is the safest robots.txt wildcard pattern?
Use the smallest pattern that matches the problem. `Disallow: /*?sort=` is safer than blocking all query strings. Test every wildcard against real URLs before shipping.
Why does Google ignore crawl-delay?
Google does not use `Crawl-delay` as a control signal. If crawl volume is too high, reduce wasteful URLs or improve server response instead of depending on that directive.
// FREE-AUDIT

Get a free 30-minute technical SEO audit

Send your URL and one symptom. You'll get a Loom walkthrough back within 48 hours — no sales call.

Request a free audit
In plain English: Robots.txt should trim crawl waste, not hide important pages; if it changes indexing, the setup is probably wrong.