Robots.txt Generator

Build the small file with outsized consequences: choose which crawlers may go where, add your sitemap, and download a syntactically correct robots.txt — with the traps (it is not security, and Disallow is not noindex) explained before they catch you.

Build your robots.txt

In short

An empty Disallow means "everything allowed"; Disallow: / means "go away entirely" — the most expensive typo in SEO. Generate carefully, test in Search Console, then upload to your domain root.

The syntax, briefly and exactly

A robots.txt is a list of groups. Each group names one or more crawlers with User-agent: lines, then gives them Allow: and Disallow: path rules. A crawler obeys the most specific group that names it (or the * group if none does). Paths are prefixes matched from the left: Disallow: /tmp blocks /tmp, /tmp.html and /temporary — a fact that has bitten many sites — while a $ at the end anchors the match (Disallow: /*.pdf$ blocks PDFs). When Allow and Disallow both match, the longer (more specific) rule wins in Google's implementation. Two disciplines keep the file safe: start permissive and restrict deliberately, testing each change in Google Search Console's robots.txt tester before it goes live; and never list anything in the file that you would not read aloud in public, because the file is public and is the first place the curious look.

How to use this generator

  1. Add a rule for each path you want to manage: choose Disallow or Allow, type the path (starting with /).
  2. Use the bot field only when a rule is for one crawler (e.g. GPTBot); leave it as * for all bots.
  3. Add your sitemap URL.
  4. Copy or download the file, place it at your domain root as robots.txt, and verify it loads at yoursite.com/robots.txt.

Warning: a wrong robots.txt can remove your site from search results. Test changes in Google Search Console's robots.txt tester, and never use the file to protect private content — it cannot.

Frequently asked questions

What is robots.txt and where does it go?

A plain-text file at the root of your domain — example.com/robots.txt — that tells visiting crawlers which paths they may and may not fetch. It must live at exactly that address, be named exactly 'robots.txt', and be publicly readable. Crawlers check it before crawling; it is a request they conventionally honour, not a security mechanism.

What is the difference between Disallow and noindex?

Disallow stops a crawler from fetching the page — so it never sees the page's content, including any noindex tag inside it. A page blocked by robots.txt can still appear in search results as a bare link if other sites link to it. To keep a page out of results, it must be crawlable and carry a noindex directive. Blocking a page in robots.txt to 'hide' it is the classic mistake: it hides the content from the crawler, not the URL from the index.

How do I block a folder from all crawlers?

Two lines: 'User-agent: *' (all bots) and 'Disallow: /folder/' — the trailing slash matters, and paths are prefixes: /admin blocks /admin, /admin.html and /administrator alike unless you anchor carefully. The generator builds these blocks for you, one per rule, and orders them safely.

Can robots.txt protect private pages?

No — it advertises them. The file is public, so listing /secret-admin/ in a Disallow tells every reader exactly where the interesting door is. Private content needs authentication. Use robots.txt only to manage crawler effort on public sites: keeping bots out of search-result pages, faceted filters, staging copies and infinite calendar traps.

Should I add my sitemap to robots.txt?

Yes — a 'Sitemap: https://example.com/sitemap.xml' line at the end is a standard, harmless hint that helps crawlers discover the file even before you submit it in Search Console. This generator appends it when you provide the URL.

Related tools