Free Online Robots.txt Generator and Rule Tester
Write user-agent groups with Allow and Disallow paths, a crawl delay and your sitemap lines, starting from a preset if you like. Then paste a path into the tester and read which rule wins and why, using the real rule that the longest matching pattern takes precedence.
Add a rule to see a verdict.
Enjoying WizTools123? Help keep our server infrastructure 100% free and open for everyone.
How a Crawler Decides, Step by Step
One group, then the longest match, then Allow on a tie.
First the crawler picks one group, and only one. If the file has a group naming that
crawler, it uses that group and ignores the * group completely. So a file with a
Googlebot group and a * group does not give Googlebot both sets of
rules; it gives it only its own. This is the single most common surprise in robots.txt, and it
is why a rule added to the * group sometimes appears to do nothing.
Then, within that group, every Allow and Disallow whose pattern
matches the path is collected, and the one with the longest pattern wins. Order in the
file is irrelevant. If two matching patterns are the same length, Allow wins.
That is how Disallow: /wp-admin/ with
Allow: /wp-admin/admin-ajax.php works: the allow is longer, so that one file stays
crawlable while the folder does not.
Two wildcards are supported by the big crawlers: * matches any run of characters,
and $ at the end of a pattern anchors it to the end of the URL. So
Disallow: /*.pdf$ blocks PDFs but not /notes.pdf.html. The tester on
this page implements all of this, including the anchoring, so you can check a path rather than
reason it out.
How to Write a Robots.txt File
A few steps, and nothing is uploaded.
What to Know About Robots.txt
Including why it will not keep a page out of search results.
noindex meta tag or an X-Robots-Tag header, and for that to be read the page must not be blocked in robots.txt. Blocking and noindexing the same URL cancels itself out.
Allow winning a tie. Moving a line higher up changes nothing at all, which is why the tester here reports the winning rule rather than the first match.
/robots.txt, and a copy in a subfolder is never read.
Key Features & Capabilities
What this tool does, and what it deliberately does not.
About the Robots.txt Generator
Robots.txt is a plain text file at the root of a host that tells crawlers which paths they may fetch. It is old, it is simple, and it is misunderstood more than almost anything else in web publishing, because the rules for choosing between two conflicting lines are not written anywhere near the file itself.
This page has two halves. The builder writes groups of rules, with presets for the situations that come up constantly: a staging site nobody should index, the two or three WordPress paths worth blocking, and the growing list of crawlers that collect text for language models. The tester then runs a path through the file you just built and reports which rule decided the answer.
The tester was the part worth getting right. It implements group selection properly, so a named crawler ignores the * group entirely, and it implements precedence properly, so the longest matching pattern wins and Allow breaks a tie. It also lists the rules that matched and lost, because when a path is blocked and you did not expect it, the useful information is which line did it.
Frequently Asked Questions
Precedence, wildcards, noindex and where the file must live.
noindex meta tag or an X-Robots-Tag header, because a blocked page can never be read to discover the noindex.Allow wins when two matches are the same length. That is why Allow: /wp-admin/admin-ajax.php beats Disallow: /wp-admin/ no matter which line comes first.*. If your file has a Googlebot group, Googlebot never reads the * group at all, so a rule added there does nothing for it. Repeat the rule in the named group, or remove the named group.* for any run of characters and $ to anchor the pattern to the end of the URL. So /*.pdf$ matches a URL ending in .pdf. These are extensions rather than part of the original standard, so an obscure crawler may treat them literally.https://example.com/robots.txt, and it applies only to that host and protocol. A subdomain needs its own file, and a copy in a subfolder is never read. Keep it under 500 kibibytes, which is where Google stops reading.Every Other Developer Tool
88 more tools in this set. All free, all in your browser.