Snoika
Glossary·Technical SEO

What is robots.txt

Definition

Robots.txt is a plain text file at the root of a website.

It tells crawlers which URLs they may request. Search engines and AI bots fetch it before they crawl anything else, and the file uses it to ask them to skip certain paths. It can't force a bot to obey, and it doesn't remove pages from search results. Robots.txt contains crawl requests that well-behaved bots choose to follow.

TermRobots.txt3 min read · reviewed by the Snoika team

Robots.txt defined for SEO

In SEO, robots.txt is the file that decides which parts of a site search engine bots spend their time on. It follows the Robots Exclusion Protocol. Martijn Koster proposed the protocol in 1994, and the Internet Engineering Task Force (IETF) later published it as RFC 9309. Technical SEO teams use the file to keep bots away from low-value URLs, such as internal search results or filtered category pages. Make sure it sits at yourdomain.com/robots.txt, because crawlers don't look for it anywhere else. Each subdomain needs its own file.

What the file actually does

Robots.txt tells crawlers which URLs they shouldn't request, and that's all it does. Google Search Central says the file mainly stops crawlers from overloading your server and "is not a mechanism for keeping a web page out of Google." Links from other sites allow a disallowed page to appear in results as a bare URL with no description. To keep a page out of search, use a noindex tag or a password. Don't put a noindex tag on a URL you've also blocked, because the crawler never fetches the page and never sees the tag.

How crawlers read it

A crawler looks for the group of rules addressed to its own name and follows only that group. Each group opens with a User-agent line, followed by Disallow and Allow lines that list URL paths. If no group names the bot, it falls back to the group marked with an asterisk. When two rules match the same URL, Google applies the more specific one, which means the rule with the longer path. Paths are case-sensitive, so /Blog/ and /blog/ are different folders.

Blocked by robots.txt explained

"Blocked by robots.txt" means a crawler wanted a URL, but your file told it not to fetch that page. Google Search Console shows this status in its page indexing report. Sometimes the block is deliberate, as with admin pages or cart URLs. A leftover "Disallow: /" from a staging site, or a rule that blocks your CSS folder, can hide pages you want ranked. Audit each flagged URL against the file and confirm you meant to block it.

Can robots.txt be ignored

Yes. Any crawler can ignore robots.txt, because the file has no way to enforce its rules. Google notes that Googlebot and other respectable crawlers obey it, but "other crawlers might not." RFC 9309 adds a second warning: listing a path in the file makes it public and discoverable. So never list a private folder in robots.txt to hide it. Protect that folder with proxy or server authentication.

Robots.txt for AI crawlers

AI crawlers read robots.txt the same way search bots do, and each AI company publishes the user-agent names you can address. A company that runs several bots with different jobs needs separate rules to cover them all.

Training crawlers

OpenAI's GPTBot collects content for model training. OpenAI says that blocking GPTBot indicates your content shouldn't be used for that training. Google handles AI training opt-outs through a separate token, Google-Extended. Blocking that token doesn't touch Googlebot's search crawl.

Search and assistant crawlers

OAI-SearchBot fetches pages for ChatGPT search, and OpenAI treats each bot setting as independent. You can allow OAI-SearchBot while you block GPTBot. Before you block any AI bot, decide whether you want your pages to appear in AI assistant answers. Blocking a search crawler can keep you out of them.

A minimal robots.txt example

In this example, the first group lets every crawler in, except to the admin area and internal search pages. The second group keeps GPTBot off the whole site. An empty "Disallow:" line allows crawling, while "Disallow: /" blocks everything. One slash separates those two outcomes, so test every change before you publish it.

User-agent: *
Disallow: /admin/
Disallow: /search

User-agent: GPTBot
Disallow: /

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

Related SEO terms

Robots.txt controls crawling.

Noindexa meta tag or HTTP header that keeps a crawled page out of search results.
Meta robots taginstructions on the page itself, which a crawler reads only after it fetches the page.
XML sitemapa list of URLs you want crawled, the opposite of a block list.
Crawl budgethow many URLs a search engine will crawl on your site in a given period.
User agentthe name a crawler uses to identify itself, which robots.txt groups match against.

Knowing what is robots.txt, and what it isn't, keeps you from using it for a job another tool does better. Open yourdomain.com/robots.txt now and read every Disallow line. If a line blocks a page you want found, delete that line.

Look up more AI search and SEO terms in our glossary.

Related terms

All terms
Reverse proxyA reverse proxy is a server that sits in front of a website and gets every request before the site's own server does. It decides where each request goes, then sends the answer back to the visitor. A reverse proxy is a gatekeeper on the website's side of the connection. Visitors and crawlers only eveStructured dataStructured data is information arranged in fixed, labeled fields, so a machine can read it without guessing what it means. On a website, the term means schema markup. That's code in a format such as JSON-LD that tells search engines and AI assistants exactly what a page describes, such as a product SubdomainA subdomain is a label added to the left of a registered domain name. It creates a separate address under that domain, such as blog.example.com under example.com. The domain owner can create subdomains at no extra cost and point each one to its own server. A subdomain is a named branch of a domain tOrphan pageAn orphan page is a live page on a website that no other page on the same site links to. Visitors and search engine crawlers can reach it through a direct URL or a sitemap entry. A link from another domain provides the only other route. In SEO, orphan content sits outside the site's internal link structure.HreflangHreflang is an HTML attribute that tells search engines which language and region each version of a page is written for. If you're asking what is hreflang, you mean the hreflang tag in a page's head. It lists every translated or regional copy of a page so Google can show each searcher the copy in their language.

See how AI talks about your brand

Get free audit