← Back to the blog
Technical SEO

Sitemap not indicated in robots.txt: what it does and does not break

This is an audit warning, not a Search Console fetch error. Decide whether to declare the sitemap, format the line correctly, and verify robots.txt itself.

By Launcholio5 min read

This message is not a Search Console error

“Sitemap not indicated in robots.txt” comes from audit tools such as Lighthouse. Search Console does not require a Sitemap line, and sites without one can still have every URL discovered through links and a submitted sitemap.

The line is useful because it gives crawlers one more place to find the file. It is not access control, and it does not make Google index anything faster on its own.

Add the line correctly

Place the directive at the top level of robots.txt, outside any user-agent group. Use the final HTTPS origin and the exact sitemap URL you submitted in Search Console.

  • One Sitemap line per sitemap file; an index needs only the index URL.
  • Use the same protocol and host that serve the pages.
  • Do not point at a staging or preview domain.
  • Keep the file reachable at /robots.txt with a 200 response.
User-agent: *
Allow: /

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

Check the robots.txt response itself

A line in the file means nothing if the file is not served. Fetch /robots.txt and confirm a 200 response with a text/plain content type. A CDN challenge, an HTML fallback, or a blanket Disallow can all block discovery while the sitemap itself is fine.

If you intentionally block a path, remember that robots.txt is public and is not a way to hide a page. Use noindex for that, and keep private areas behind authentication.

Frequently asked questions

Will adding the line fix indexing? No. It can improve discovery, but indexing still depends on the page being crawlable, useful and not duplicated.

Do I need the line if the sitemap is submitted in Search Console? No, but it costs nothing and keeps other crawlers informed.

Can robots.txt block the sitemap? Yes. If the sitemap path is disallowed, Google may not fetch it; check the Disallow rules before blaming the XML.

Check crawl access before editing robots.txt

A free audit shows whether the page and its assets are reachable, and whether anything is accidentally blocked.

Run a free audit