Robots.txt Generator: Allow, Disallow and Sitemap Lines

Choose which paths crawlers may visit and the file is written line by line as you type. Paths and sitemap addresses are checked before they are used.

TechFreeNo sign-upWorks on phones
0User-agent groups
0Allow and Disallow rules
0Sitemap lines
Your robots.txt

This file is a request to well-behaved crawlers. It does not hide or protect anything, so never rely on it for private pages.

This tool runs in your browser. Nothing you type is uploaded or saved, and there is nothing to install or sign up for.

What a robots.txt file is, and what it is not

A robots.txt file is a short plain-text notice that a website leaves for automated visitors. Before a well-behaved crawler fetches your pages, it reads the notice to learn which paths it has been asked to stay out of. The format is defined by the Robots Exclusion Protocol, published as RFC 9309 (read December 2026).

Two limits matter before you write a single rule. First, the standard itself says that these rules are not a form of access authorization. A crawler that chooses to ignore the file can still fetch everything, and so can any person with the address. Second, Google’s Search Central guide (read December 2026) says the file is not a mechanism for keeping a web page out of Google: a blocked address can still appear in results if other pages link to it, only without a description. In short, robots.txt manages crawling. It does not manage indexing, privacy or security.

Building your file with this generator

  1. Pick the starting rule. Open site, block listed paths suits almost every public site. Block the whole site writes Disallow: / and shows a warning.
  2. In Paths to block, type one path per line, each beginning with a forward slash.
  3. In Exceptions, list any page or sub-folder inside a blocked area that crawlers may still fetch.
  4. Optionally name crawlers to shut out fully, set a crawl-delay, and paste the full address of each sitemap.
  5. Read the three tiles to confirm the number of groups, rules and sitemap lines, then press Copy file or Download robots.txt.

Reset returns to the starting example and Empty every field leaves the shortest valid file, which allows everything.

Worked example: a school club website

The generator opens with a small site that keeps unfinished pages in a drafts folder and has an on-site search page. It blocks /drafts/ and /search, lets crawlers into /drafts/published/, and points to one sitemap. The file it writes has one group, three rules and one sitemap line:

User-agent: *
Disallow: /drafts/
Disallow: /search
Allow: /drafts/published/

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

Type ExampleBot into the named crawlers box and a second group is added between the rules and the sitemap line, making two groups and four rules:

User-agent: ExampleBot
Disallow: /

How crawlers read the rules

RFC 9309 describes the file as a list of groups. Each group starts with one or more User-agent lines naming a crawler, followed by Allow and Disallow rules. A crawler looks for a group that names it, matching the name without regard to upper or lower case, and falls back to the * group only when no group names it.

LineMeaning under RFC 9309
User-agent: *Starts the group for every crawler that has no group of its own
Disallow: /drafts/Asks crawlers not to fetch addresses whose path begins with /drafts/
Allow: /drafts/published/Permits a more specific path inside a blocked one
Disallow:An empty value blocks nothing
Disallow: /Matches every path on the site
* and $ in a pathAny run of characters, and the end of the address
#Starts a comment

When several rules match one address, the standard says the most specific match, meaning the longest path, must be used. That is why /drafts/published/ beats /drafts/ in the example. If nothing matches, the address is allowed. The Sitemap line is not part of the protocol itself. The standard mentions it as one of the other records a crawler may choose to read, and Crawl-delay is not defined there at all, so support for it varies from crawler to crawler.

Where the finished file goes

The standard requires the rules to be reachable in a file named /robots.txt, in lower case, at the top-level path of the site. For a site at example.com that means the address example.com/robots.txt. A copy placed in a sub-folder is not read. Each subdomain is a separate host and needs its own file.

Checks the generator runs for you

  • Blank lines, repeated lines and lines starting with # in the path boxes are dropped. If your pasted list is messy, the duplicate line remover can tidy it first.
  • A path without a leading slash, such as drafts/, is refused with a message that names it, and only the valid paths are written.
  • A sitemap must be a complete address. /sitemap.xml alone is refused.
  • Crawler names may contain letters, digits, hyphens and underscores. A name typed twice in different letter case is written once.
  • A crawl-delay outside 1 to 3600 seconds is left out.

Mistakes that cause real damage

  • Leaving Disallow: / on a live site. This single line asks every crawler to skip every page. It is common on test copies of a site and easy to forget at launch, which is why the generator warns you each time.
  • Using the file to hide something. Anyone can open your robots.txt and read the list of paths, so naming a secret folder there only advertises it. Protect private pages with a login and a strong password from the password generator.
  • Blocking a page you want removed from search. Google says to use a noindex rule or password protection for that. A crawler that is blocked from a page can never read a noindex tag on it, so write the tag with the meta tag generator and leave the page crawlable.
  • Blocking style sheets or scripts. A crawler that cannot fetch the files a page depends on may not see the page the way visitors do.
  • Odd characters in paths. Spaces are refused. For addresses with accents or symbols, convert the path with the URL encoder before you paste it.

Practical advice for small sites

Most school, club and personal sites need very little: the open-site rule, perhaps one or two blocked utility paths, and a sitemap line. Start with the shortest file that does the job, upload it, then open the address in your browser to confirm it loads as plain text. Keep a dated copy each time you change it, so a mistake is easy to undo.

For teachers, the file is a neat way to show how the web relies on published conventions: students can open the robots.txt of well-known sites, read the groups, and predict which paths a crawler would skip.

Other site-building helpers sit with the tech tools, and the full list of free online tools is one click away.

Frequently asked questions

Where do I put the robots.txt file?

At the top level of your site, so that it opens at yourdomain/robots.txt with the name in lower case. RFC 9309 requires that location, and a copy inside a sub-folder is not read.

What does Disallow: / mean?

It matches every path, so it asks crawlers to stay away from the whole site. Use it only for a site that should not be crawled at all, such as a private test copy.

Does robots.txt stop a page from showing in Google?

No. Google says the file is not a mechanism for keeping a page out of its results, and a blocked address can still be listed without a description. Use a noindex rule or a password for that.

Is robots.txt a security feature?

No. The standard states that the rules are not a form of access authorization. The file is public, and a crawler or a person can ignore it, so private content needs real access control.

What is the simplest robots.txt that allows everything?

Two lines: User-agent: * followed by Disallow: with nothing after the colon. Press Empty every field in the generator to produce exactly that.

Which rule wins when Allow and Disallow both match?

Under RFC 9309 the most specific rule wins, which means the one with the longest path. That is how an Allow line for a sub-folder can open part of a blocked folder.

Related tools

Browse all free tools →