Guides

How to create a robots.txt file

Understand sitemap lines, allow rules, disallow rules, and common robots.txt mistakes.

SEO4 min read
Quick guide

What to check first

Robots.txt gives crawler instructions

A robots.txt file tells crawlers which parts of a site they may access. It is often used to point crawlers to the sitemap and block low-value technical paths.

It is not a security tool. Private pages should be protected by authentication, not only blocked in robots.txt.

Include your sitemap

Adding a sitemap line helps crawlers find the XML sitemap. This is especially useful for sites with many tool, category, or blog pages.

Use the full sitemap URL so there is no ambiguity.

  • Use one User-agent block for general rules
  • Add Sitemap with the full URL
  • Do not block pages you want indexed

Test rules carefully

A small robots.txt mistake can block important pages from being crawled. Review disallow rules before deploying them.

If your goal is search traffic, make sure your main tool pages and blog guides are crawlable.

Frequently asked questions

Can robots.txt hide private content?

No. It can discourage crawling, but it does not protect private content from users who know the URL.

Should robots.txt include a sitemap?

Yes, adding a sitemap URL is a common and useful practice.