robots.txt: how to set it up without blocking Google
robots.txt is a plain text file at the root of your site that tells crawlers which parts of the site they may visit.
Why it matters
A single Disallow: / under User-agent: * blocks every search engine from your entire site. This is a common leftover from development sites.
AI search tools such as ChatGPT, Claude and Perplexity use their own crawlers. If robots.txt blocks them, your content can’t be read or cited in AI answers. Whether to allow them is your choice, but it should be a deliberate one.
If robots.txt returns a server error, Google may stop crawling the site until it can read the file again.
How to fix it
- Create a file named
robots.txtat the root of your domain, for examplehttps://www.example.com/robots.txt. - Allow everything by default and only disallow private areas like admin or cart pages.
- Add a
Sitemap:line with the full URL of your XML sitemap. - Decide on AI crawlers (GPTBot, OAI-SearchBot, ClaudeBot, PerplexityBot, Google-Extended and others) and add explicit rules for any you want to block.
- Test URLs against your rules with our robots.txt tester before publishing changes.
User-agent: *
Disallow: /admin/
Disallow: /cart/
Sitemap: https://www.example.com/sitemap.xml