Inventory URLs before writing rules

Configure robots.txt without guessing broad restrictions

There is no universal robots.txt for every website. A safe file begins with understanding the site structure and testing representative valuable and service URLs.

  • save the present file;
  • test URL patterns, not isolated examples;
  • publish only after validation.
robots.txt configuration process: website inventory, rule drafting and testing before publication
Inventory → draft → test valuable URLs → publish → retest.

Message for a developer

“Review and save the current /robots.txt. List valuable pages that must remain crawlable and service URL patterns that may be blocked. Add only justified rules, declare the working Sitemap, and show tests of representative URLs for Googlebot before publication. Do not apply a blanket parameter restriction until pagination, filters, CSS, JavaScript and images have been checked.”

What to prepare

  • the current robots.txt and a backup of its generator or configuration;
  • valuable page types: categories, products, services and articles;
  • examples of search, filters, cart, account, parameters and duplicates;
  • the current sitemap.xml location;
  • CMS, repository or web-root access for publication.

Step-by-step configuration

  1. Open https://example.com/robots.txt and save the file.
  2. Confirm a 200 response for the correct protocol, hostname and subdomain.
  3. Collect real valuable and service URL patterns from a crawl, analytics and CMS.
  4. Start with a minimal file and add restrictions only for a clear reason.
  5. Test every rule against valuable, edge-case and service URLs.
  6. Publish in the host root, clear the relevant cache and retest.
  7. Monitor Search Console reports and crawl logs after the change.

Safe minimal example

User-agent: *
Disallow:

Sitemap: https://example.com/sitemap.xml

An empty Disallow does not block crawling. Add only rules justified by this website's structure.

Targeted example

User-agent: *
Disallow: /cart/
Disallow: /account/
Disallow: /internal-search/

Sitemap: https://example.com/sitemap.xml

Technical check and rollback

curl -i https://example.com/robots.txt
curl -sS https://example.com/robots.txt

The file should be plain text, accessible without authentication or redirect loops. Compare syntax and behaviour with the official Google documentation.

If valuable URLs become blocked, restore the saved version or safe minimal file immediately, clear cache and retest. robots.txt controls crawling; it is not a secure way to hide confidential data or remove a URL from the index.

Use the manual verification guide afterwards. Fixing noindex, canonical, sitemap and URL architecture is separate work. If the rules remain uncertain, order configuration.

Content history

  1. — Added a safe change process, primary sources and rollback steps.