Robots.txt Rules: What Google Says You Can (and Can't) Put in the File

Author: Hidayatul Haq | 8 min read | Nov 5, 2026

Robots.txt Rules

Robots.txt is often the first file a crawler reads on your site, and it's tempting to get creative with it. Some site owners decorate it with ASCII art. Others add emoji, non-English paths, or home-made lines like "no AI training, please."

So which robots.txt rules actually work? On October 21, 2026, Google Search Central published What can you actually put in a robots.txt?, the second episode of its sitcom-style series The Non-Canonical Cabinet. Google's Gary Illyes and Cherry Prommawin test the strange edge cases site owners keep asking about, from emoji user-agents to blocking AI training.

Their verdict fits in five words: "Let's keep it boring. Beautifully boring." Below, we break down each question from the episode, check it against Google's documentation, and turn the answers into a checklist you can use today.

What can you put in a robots.txt file?

Google understands four kinds of lines in a robots.txt file: user-agent, allow, disallow and sitemap. Comments that start with # are allowed and ignored. Everything else is silently discarded.

Here's what a clean, standard robots.txt looks like:

# All crawlers: skip the cart and internal search results
User-agent: *
Disallow: /cart/
Disallow: /search/
Allow: /search/help/

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

A few ground rules from Google's robots.txt specification:

  • It lives at the root of the host, like example.com/robots.txt. Each subdomain, protocol and port needs its own file.
  • It must be UTF-8 plain text. Google ignores anything past 500 KiB.
  • Field names aren't case-sensitive, but paths are. /Cart/ and /cart/ are different rules.
  • It follows an internet standard. Robots.txt is defined by RFC 9309, which Google follows.

What Google's robots.txt video covers

The episode runs as a comedy sketch (a chicken is the running test subject), but every segment tackles a real question. Here's how it breaks down, based on Google's official chapter markers:

Timestamp

Topic

00:00

Cold open: a "no entry" sign in the cabinet

00:46

What robots.txt is, and the RFC 9309 standard

02:10

Can you put ASCII art in robots.txt?

03:13

How parsers handle formatting mistakes and custom rules

04:04

Emoji and non-English characters in user-agent tokens

04:54

Emoji and non-English characters in URL paths

06:15

Why to percent-encode non-ASCII paths

07:06

Generative AI: what robots.txt can and can't control

08:26

Recap

The Non-Canonical Cabinet launched in October 2026 to answer oddly specific technical SEO questions from the community. The first episode covered what you can put in a URL, and the one after this tackled 404 status codes.

Can you put ASCII art or comments in robots.txt?

Yes. Any line that starts with # is a comment, and crawlers skip it entirely. Gary concedes you could paste a giant ASCII chicken into the file, while calling it a questionable life choice.

There are two catches worth knowing:

  • File size. Google reads only the first 500 KiB of a robots.txt file and ignores the rest. Cherry mentions finding a robots.txt that was 97% decoration and only 3% actual directives. At best, that wastes bandwidth. At worst, rules buried below a huge comment block fall past the limit.
  • Comments inside rule lines. Google ignores everything after a # character. A line like Disallow: /private#notes is read as Disallow: /private, which may block far more than you meant.

The safe habit: put comments on their own lines, keep them short, and keep the art out of your directives.

What happens to custom or non-standard robots.txt rules?

Google ignores them, without any warning. Its parser reads the file line by line, keeps the fields it supports, and silently drops anything it doesn't understand. Gary's example: write a plain-English line like "don't crawl secret page," and Google discards it as invalid. Your secret page may get crawled anyway.

Lines that Google's parser throws away include:

  • crawl-delay, which Google's specification explicitly says it doesn't support
  • noindex inside robots.txt, which isn't one of the supported fields
  • Invented directives, such as a made-up "No-AI-Training" rule

Other crawlers may treat extra lines differently, because the standard lets each crawler decide how to handle records outside the protocol. That's exactly why non-standard rules are unreliable: you can't know who honors them.

Two misconceptions to drop

Disallow isn't deindex. Blocking a URL stops Google from reading the page, but Google may still index the URL itself and show it without a snippet if other pages link to it. To keep a page out of search results, use noindex and leave the page crawlable so Google can see the tag.

Robots.txt isn't security. It asks well-behaved crawlers to stay out. It doesn't stop anyone, or any badly behaved bot, from loading the URL. Private content needs authentication.

Can you use emoji or non-English characters in user-agent lines?

No. As Gary explains in the episode, user-agent tokens are limited to letters and dashes. An emoji is a multibyte UTF-8 character that can't fit that format, so a line like User-agent: 🐔 simply won't work. The same goes for non-English characters. (And no, there's no chicken bot.)

To target crawlers reliably:

  • Copy tokens exactly from each crawler's documentation. Google keeps a list of its common crawlers with tokens such as Googlebot, Googlebot-Image, Storebot-Google, and Google-Extended.
  • Don't worry about capitalization. Google treats the user-agent value as case-insensitive.
  • Know that the most specific group wins. Each crawler follows only the most specific group that matches it. Google doesn't merge a crawler's own group with the * group.

That last rule catches a lot of sites. Look at this file:

User-agent: *
Disallow: /checkout/

User-agent: Googlebot
Disallow: /internal-search/

Googlebot follows only its own group here, so it can crawl /checkout/. If you give a crawler its own group, repeat every shared rule inside it.

Should you percent-encode emoji and non-English URL paths?

Yes. URL paths can legitimately contain German umlauts, Chinese characters, Arabic script, or even emoji, and robots.txt rules can target them. The question is how you write those rules.

Google is flexible here. It converts raw UTF-8 rule paths into their percent-encoded form before matching, so Disallow: /foo/bar/ツ and Disallow: /foo/bar/%E3%83%84 behave identically for Googlebot.

Other crawlers may not be so forgiving. Cherry's advice in the episode is to write the encoded version in your robots.txt rules, because older or less capable parsers can get confused by raw characters. Worse, a crawler that can't process a line might ignore the whole disallow rule and crawl exactly what you meant to protect.

Path type

Raw rule

Percent-encoded rule

German umlaut

Disallow: /hähnchen/

Disallow: /h%C3%A4hnchen/

Emoji

Disallow: /🐔-gear/

Disallow: /%F0%9F%90%94-gear/

Japanese character

Disallow: /foo/bar/ツ

Disallow: /foo/bar/%E3%83%84

Gary's tip is to mirror what your server actually expects. Check how the URL appears in your server logs, then copy that encoded form into the rule.

This matters most for multilingual sites, where localized URL paths are common. If you run one, our international SEO audit guide is a good next read.

Can robots.txt stop AI from training on your content?

Not on its own. This is the biggest takeaway from the episode. Gary describes robots.txt under RFC 9309 as "an access preference protocol". It tells a crawler which URLs it may or may not fetch. It says nothing about what a company does with content it has already crawled.

In other words, disallow means "don't enter this room." It isn't a license agreement.

What you can actually do today

  • Block specific AI crawlers by their own token. If you want a particular AI crawler out of your site entirely, you have to name its user-agent token in the file. A made-up rule like "No-AI-Training" is simply discarded.
  • Use Google-Extended for Google's AI products. Google-Extended is a control token, not a separate crawler. It lets you decide whether content Google crawls can be used to train future Gemini models and for grounding in Gemini Apps and Grounding with Google Search on Vertex AI. Google states it has no effect on inclusion or ranking in Google Search. The episode didn't cover it on air, but the video description links to Google's crawler list, where it's documented.
User-agent: Google-Extended
Disallow: /

What's coming next

A shared, standard way to state AI training preferences is still being built. Google's crawler documentation says Google intends to support the AIPREF training-preference signal, written asuser-agent: __usage_ai-training, in early 2027. Separately, Gary Illyes co-authored an IETF draft with Mozilla's Martin Thomson that would add a Content-Usage rule to robots.txt. That proposal is still a draft.

Think before you block

Blocking AI crawlers is a business decision, not just a technical one. If a crawler can't fetch your pages, the product behind it can't use them, and that can include AI answers that might cite or recommend you. Decide crawler by crawler. If AI visibility matters to you, our guide on how to optimize content for AI search engines and our GEO services cover the other side of that trade-off.

Robots.txt checklist: keep it beautifully boring

Use this list to review your file, or any change before it goes live:

  1. One file per host, at the root. example.com, www.example.com and shop.example.com each need their own robots.txt.
  2. UTF-8 plain text, well under 500 KiB. Anything past the limit is ignored.
  3. Only the four supported fields. user-agent, allow, disallow, and sitemap. Nothing invented.
  4. Comments on their own lines. Everything after a # is ignored, even mid-rule.
  5. Exact user-agent tokens. Copy them from each crawler's documentation, and repeat shared rules inside any crawler-specific group.
  6. Percent-encoded non-ASCII paths. Mirror the encoded form your server uses.
  7. Know which rule wins. Google applies the most specific (longest) matching path. When an allow and a disallow tie, the less restrictive allow wins.
  8. Don't use robots.txt to deindex or protect pages. Use noindex for search results and authentication for privacy.
  9. Make sure the file returns a 200 status. Errors change how Google crawls your whole site (see below).
  10. Allow time after changes. Google generally caches robots.txt for up to 24 hours.

If your CMS generates robots.txt for you, as WordPress and Shopify do by default, check what it actually outputs before adding your own rules. Our WordPress SEO and Shopify SEO services can help if you're not sure what your platform is serving. For a wider review, our franchise website audit checklist shows where robots.txt fits in a full technical audit.

What happens if your robots.txt returns an error?

The status code of the robots.txt file itself matters as much as its contents. Here's how Google handles each case:

robots.txt response

What Google does

2xx (success)

Reads and follows the file as served

3xx (redirect)

Follows at least five redirect hops, then treats the file as a 404

4xx, except 429

Acts as if no robots.txt exists, so there are no crawl restrictions

5xx or network error

Stops crawling the site for 12 hours, then uses the last good copy for up to 30 days

That last row is the scary one. A robots.txt that throws server errors can pause Google's crawling of your entire site.

Frequently asked questions about robots.txt rules

What can you put in a robots.txt file?

Google supports four fields: user-agent, allow, disallow, and sitemap. You can also add comments that start with #. Any other line is ignored by Google's parser.

Can you use emoji in robots.txt?

In URL paths, yes, but percent-encode them so every crawler can read the rule. In user-agent lines, no. User-agent tokens can't contain emoji or non-English characters.

Does Google support crawl-delay in robots.txt?

No. Google's robots.txt specification states that crawl-delay isn't supported. Google adjusts its crawl rate based on how your server responds.

Can robots.txt stop AI from training on my content?

Not by itself. Robots.txt controls which URLs a crawler may fetch, not how fetched content is used. You can block specific AI crawlers by their tokens, and use Google-Extended to control use in Google's Gemini models.

Does disallow remove a page from Google?

No. Disallow stops Google from crawling the page, but the URL can still be indexed without a snippet if other pages link to it. Use a noindex tag on a crawlable page instead.

Is robots.txt case-sensitive?

Partly. Field names like Disallow and user-agent values like Googlebot aren't case-sensitive. URL paths in rules are, so /Folder/ and /folder/ are different.

Where should robots.txt be placed?

At the root of each host, such as example.com/robots.txt. Google doesn't look for robots.txt files in subdirectories, and each subdomain needs its own file.

How big can a robots.txt file be?

Google reads up to 500 KiB. Anything after that limit is ignored, so keep decoration and long comment blocks to a minimum.

Final thoughts: boring robots.txt files win

Google's message in this episode is refreshingly practical. Robots.txt is a machine-readable file with four supported fields, not a place for creativity. Comments are fine, invented rules are ignored, emoji don't belong in user-agent lines, non-English paths should be percent-encoded, and AI training needs more than a disallow line.

The risk with robots.txt is that mistakes are silent. A misplaced #, a crawler-specific group missing a shared rule, or a file that starts throwing server errors can change how your whole site is crawled without any warning. That's why it belongs in every technical review, not just at launch.

KodRank's technical SEO services cover crawlability checks like these alongside indexation and site architecture. Want a second pair of eyes on your file? Request a free audit, and we'll tell you what's working and what's being ignored.

Hidayatul Haq

— Written by

Hidayatul Haq

Founder, KodRank · SEO Strategist

Hidayat is the founder and CEO of KodRank and a top-rated SEO strategist who has delivered 150+ projects across the globe— spanning technical audits, crawl-budget recovery, on-page optimization, and full-scale organic growth programs for founders, agencies, and in-house teams.

Keep reading

More from SEO.

Straight to your inbox

One technical SEO breakdown, every other week.

No fluff, no "10 tips" listicles — just the audits, log-file findings, and fixes our team is running right now.