Use this guide as a starting point, then validate recommendations against your website, current search documentation, and the needs of your audience.

1. Find your robots.txt file

Your robots.txt file is usually available at the root of your host, such as https://example.com/robots.txt. Each subdomain has its own file. Check the live version before editing it, especially if your CMS or hosting platform generates it automatically.

2. Understand the main directives

User-agent identifies the crawler a rule applies to. Disallow tells a crawler not to request a matching path, while Allow can clarify exceptions on systems that support it. Sitemap can point crawlers to your XML sitemap. Syntax and support vary by crawler, so keep rules simple.

3. Do not block pages you want indexed

Avoid accidentally blocking important product, service, category, CSS, or JavaScript resources. A robots.txt block prevents crawling; it does not reliably remove a URL already known to a search engine from its index. Use an appropriate noindex directive when you need deindexing and ensure the crawler can access it.

4. Test changes carefully

Review every rule against real URL examples. Test staging and production separately, and check important URLs in Google Search Console after publishing. Keep a copy of the previous file so you can roll back an accidental block.

5. Keep crawl controls separate from privacy

Do not put confidential URLs or sensitive information in robots.txt as a security measure. The file is public, and disallowed URLs can still be discovered through links or other signals.

Put this into practice

Use the relevant SEOmate tool to support your workflow, then verify the result on your live website.

Open Robots.txt Generator →

This article is general educational guidance. Search engine systems change, and individual results depend on the site and query. Verify important changes with current documentation and your own data.