Robots.txt Generator
Create a robots.txt file, then review crawling restrictions before publishing it at your domain root.
FreeNo sign-upRuns in your browser: your data is not uploaded
How to generate and publish robots.txt
Open the current /robots.txt on your site and save a copy. Identify paths you want crawlers to reach and paths you want them to skip.
- Set User agent to
*for a general rules group. Use a specific crawler token when you intentionally want a group for that crawler, such asGooglebot. - Enter a single path per line in Disallow paths. Begin each with
/. If a URL inside a disallowed path should remain accessible, enter its more specific path in Allow paths. - Add the full URL of your XML sitemap if one is available. Click Generate robots.txt and compare the displayed rules with your saved copy. Keep tools, assets and crawler groups you still need.
- Use Download TXT and publish the reviewed file at the root of the target host as
robots.txt. Open the public file and check that it shows your rules as plain text.
Worked example for an internal search area
A site has search results under /search/ and public search instructions under /search/help/. Enter * for the user agent, /search/ in Disallow paths, /search/help/ in Allow paths and https://example.com/ in the sitemap field. The generator produces these rules.
User-agent: * Allow: /search/help/ Disallow: /search/ Sitemap: https://example.com/sitemap.xml
Google uses the longer matching path, so the help area remains crawlable. Check one URL under each path and one unrelated public page before replacing your live file.
Common mistakes
- Leaving a staging block in production. A
Disallow: /affects the whole host for the selected crawler. Review the file against pages you want crawled. - Using crawl rules for private content. Require authentication for private files. For a public page you want excluded from search, let the crawler reach its
noindexdirective. - Applying rules to the wrong host. Check
wwwand non-wwwhosts separately if both serve pages. Publish each file where its own pages are served.
After publishing, run a site report in SEO Workbench to check whether the public robots.txt and sitemap are reachable.
FAQ
Where should I publish robots.txt?
What does an empty Disallow line mean?
Can a disallowed URL still appear in Google?
Should I paste a full URL into Allow or Disallow?
How do I apply rules for multiple user agents?
Link to this tool
Found it useful? Put a link in your docs, README or forum answer so others can use it too:
<a href="https://headsntail.com/tools/robots-txt-generator">robots.txt Generator</a> (free, by HeadsNTail)
[robots.txt Generator](https://headsntail.com/tools/robots-txt-generator)
Share: X LinkedIn Reddit WhatsApp
Need a website, HR or business system? HeadsNTail builds websites, HR and payroll apps and business tools. See services or ask a question.