SiteAudit.dev
Tools

Crawling and indexing · Practical guide

robots.txt vs noindex: which one should you use?

Crawling, indexing and private access are different requirements. robots.txt tells cooperating crawlers what they may fetch. A readable noindex instruction controls indexing by supporting search engines. Authentication controls who can obtain private content. Decide which outcome you need before removing a warning from an audit.

Find the staging restriction still attached to production

A guide launches on production after staging used noindex in both HTML and response headers. The application template now says index, follow, but the CDN still adds X-Robots-Tag: noindex. The response below remains excluded for Google: a permissive meta tag does not cancel the more restrictive header.

Trace each instruction to its owner: CMS setting or template, application middleware, web server, CDN response rule or cached response. For this public guide, remove the unintended noindex at every applicable layer. Keep the intended protection on staging and private pages.

HTTP/1.1 200 OK
Content-Type: text/html; charset=utf-8
X-Robots-Tag: noindex

<head>
  <meta name="robots" content="index, follow">
</head>
  1. Capture the final public GET response and inspect its headers and every relevant meta tag.
  2. Correct the production template or response rule, update any affected CDN cache and allow the intended crawler to fetch the page.
  3. Repeat the public check, then use Search Console’s live test and indexed-page report for separate follow-up.

Reference: Google Search Central: conflicting robots directives

Use robots.txt to control cooperating crawlers

A Disallow rule can prevent a crawler from retrieving a path, but the URL can still be discovered through links and appear in search without its content being fetched. Do not use a crawl block as a promise that the URL will disappear from Google.

Review the rules for the actual crawler and URL, including the hostname and scheme. A rule for www.example.com does not automatically cover example.com. More specific user-agent groups and path rules can change the result. Fetch the robots.txt for the relevant origin rather than judging access from a copied fragment.

SiteAudit checks robots.txt availability and lists sitemap references; it does not evaluate Allow and Disallow rules to establish Googlebot access. Its fixed-file check is therefore useful evidence, not a crawl-permission verdict. Missing files and measurements that could not complete are different findings.

Reference: Google: robots.txt scope and rule evaluation

Keep noindex readable when exclusion is the goal

For a public page that should stay out of Google, place noindex in a robots meta tag in the HTML head or an X-Robots-Tag response header. The header also works for non-HTML resources such as PDFs. Google does not support noindex inside robots.txt.

Google must fetch the resource to read these instructions. Blocking that fetch can hide the very noindex intended to remove it. Leave the public resource crawlable when this is the chosen exclusion method, and allow time for another crawl. Adding index does not override another applicable noindex.

Private documents need authentication or another access control. Do not expose confidential content just so a crawler can read a removal instruction. robots.txt is public and neither it nor noindex prevents an unauthorized visitor from requesting an accessible file.

Reference: Google Search Central: make noindex accessible

Check the deployed GET headers and HTML

Run this macOS/Linux command in an empty working directory using the final page URL. It saves the GET response headers and HTML separately, with a twenty-second timeout. Open both files and inspect every X-Robots-Tag header and all robots or googlebot meta tags. If the response redirects, inspect its Location and repeat for the final URL.

Check the public response through the CDN after deployment. A local template or origin-only request cannot prove which headers visitors receive. A HEAD request can behave differently, so use GET for this comparison. Keep captured cookies or sensitive response values out of shared diagnostics.

SiteAudit combines bounded robots and googlebot metatags with X-Robots-Tag rules from the final response. It separates general and Googlebot observations, marks conflicting index/noindex rules and keeps unsupported syntax or incomplete HTML uncertain. It does not execute JavaScript or establish Google’s index status. Spoofing Googlebot’s user-agent in curl does not reproduce Google’s IP, rendering or fetch behavior.

curl -q -sS --max-time 20 \
  -D page.headers -o page.html \
  'https://example.com/guides/install'

Reference: Google: verifying actual crawler requests

Verify the outcome that the page actually needs

Keep one representative URL for each purpose: a public article, a deliberately excluded utility page and a private account page. Removing every restriction to improve an audit result would make those different requirements indistinguishable.

  1. For the public article, confirm a usable response, intended content, readable crawl access and no accidental indexing restriction.
  2. For the excluded public page, verify the intended noindex in the response the crawler can fetch.
  3. For the private page, test that an unauthenticated request cannot obtain its protected content.
  4. Use Search Console to distinguish a current live test from the previously indexed version. A successful fetch or indexing request does not guarantee inclusion or ranking.

Reference: Search Console: live tests and indexed-page information

Keep reading

Related guides

All guides & reference
Quick reference

Indexing signals reference: robots, noindex, canonicals and sitemaps

Compare crawl access, indexing controls, canonical signals and discovery evidence when reviewing a public page.

Open reference