Create SEO friendly robots.txt file online.
A robots.txt file provides crawling instructions for compliant search engine crawlers. It identifies which website paths crawlers are requested to access or avoid. This generator creates a basic robots.txt file using a crawler identifier, one rule and an optional sitemap URL.
User-Agent identifies the crawler that a rule applies to. Use an asterisk (*) for all crawlers that follow the Robots Exclusion Protocol, or enter a crawler token such as Googlebot.
Allow specifies a path that a compliant crawler may crawl. Disallow requests that the crawler should not crawl a matching path.
For example, Disallow: /private/ requests crawlers to avoid URLs under the /private/ directory.
Paths should begin with a forward slash and are interpreted relative to the website origin. Examples include /private/, /admin/ and /temporary/.
A Sitemap directive provides crawlers with the absolute URL of your public sitemap. Use a complete HTTP or HTTPS address. The reference helps crawlers discover the sitemap, but does not guarantee crawling or indexing.
User-agent: *
Disallow: /private/
Sitemap: https://example.com/sitemap.xml
Replace example.com with your actual website domain and change the restricted path to match your needs.
The standard robots.txt file belongs at the root of the website origin. For example: https://example.com/robots.txt
For a GitHub Pages project website hosted inside a subfolder, the hostname root and project folder are different locations. A robots.txt file inside the project folder does not replace the hostname root file.
The generator processes the entered values using JavaScript in your browser. It does not send the rules to a separate generation API or fetch the sitemap URL for verification. The website itself loads its HTML, CSS and JavaScript from its hosting provider.