TMOD LogoTMOD

Sitemap and robots.txt checker

Verifies robots.txt and your XML sitemap exist, parse, and don't block indexing.

What TMOD checks

  • Fetches /robots.txt and reports whether it exists and parses as a valid robots file.
  • Discovers your XML sitemap, from the Sitemap directive in robots.txt and from the conventional /sitemap.xml location, and follows sitemap index files to their children.
  • Counts the URLs the sitemap declares, which the page-count check then uses to judge your real site size rather than only the pages the crawler fetched.
  • Flags a robots.txt whose rules would block the crawler from reaching your content at all.
What TMOD reads from robots.txt and your sitemap, two files, four questions. robots.txt exists and parses: Checked. Googlebot is not disallowed: Fails if blocked. Mediapartners-Google is not disallowed: Fails if blocked. A sitemap exists and is referenced from robots.txt: Warns if missing.

Why it matters

robots.txt is the single most dangerous file on a website, because one wrong line silently removes the entire site from search results and nothing about the site looks broken. A `Disallow: /` left over from a staging environment is a genuinely common and genuinely catastrophic mistake.

The sitemap matters most for pages that are hard to reach by following links, new posts, deep archive pages, anything more than a few clicks from the homepage. It does not guarantee indexing, but it is how a crawler learns those URLs exist without walking your whole link graph.

There is also an important interaction people get wrong: robots.txt controls crawling, not indexing. A URL you disallow can still appear in search results, sourced from external links, because the crawler never fetched it and therefore never saw your noindex tag. To remove a page from the index you must let it be crawled and serve a noindex directive.

How to fix it

01Read your robots.txt as a stranger would

Fetch it and read every line. Anything you do not recognise, do not understand, or cannot explain the purpose of should be removed. A robots.txt with three lines you understand is better than thirty inherited from a tutorial.

02Reference the sitemap from robots.txt

Add a `Sitemap: https://yourdomain.com/sitemap.xml` line. It is the standard discovery mechanism and costs one line. Use the absolute URL, a relative path is not valid in this directive.

03Keep the sitemap honest

Every URL in it should return 200, be canonical, and be a page you actually want indexed. Listing redirects, 404s or noindexed pages wastes crawl budget and reduces trust in the file. If your CMS generates it, verify it after any structural change.

04Never use Disallow to hide a page from search

If you want a page out of the index, allow crawling and serve a noindex directive. Disallowing it prevents the crawler seeing the very instruction you need it to obey. This is the usual trap when people try to hide empty tag and author archives.

Rules that look harmless and are not

The dangerous lines in a robots.txt are rarely dramatic. Blocking an assets directory to keep the file tidy also blocks the CSS and JavaScript that render the page, so what a crawler evaluates is an unstyled document, and on a script-driven site an empty one. That single line can undo every responsive rule you wrote, because a layout cannot be assessed from stylesheets nobody is allowed to fetch.

Wildcard rules on query strings are the next most common. A pattern written to keep session parameters out of the crawl usually catches your filtered, sorted and paginated URLs too, and those are often the only route to a large part of a catalogue. Test any pattern against a handful of real URLs before shipping it rather than reasoning about it in the abstract.

Two more worth knowing. Crawl-delay is not supported by Google, so a site that added it to reduce load is still being crawled at the same rate while believing otherwise. And a Disallow line advertises what it names, which makes robots.txt a poor place to hide an admin path from anyone curious enough to read it.

robots.txt rules that quietly block Google. Each line, and what it actually does to a crawler. User-agent: *: Applies to every crawler. Disallow:: Empty value allows everything. Disallow: /: Blocks the entire site. User-agent: Mediapartners-Google: The AdSense crawler. Disallow: /wp-content/: Often blocks CSS and images too. Sitemap: https://example.com/sitemap.xml: Absolute URL, as required.

Sitemap hygiene once a site grows

A sitemap tops out at 50,000 URLs and 50MB uncompressed, after which you split it and point a sitemap index at the parts. Splitting by content type rather than arbitrarily is worth the small effort, because the coverage report then tells you which type has a problem instead of which numbered file does.

The rule for what goes in is narrow: one entry per page, the canonical URL, returning 200, and a page you would be happy to see in results. That excludes redirects, the non-canonical variants of a page, noindexed archives and anything blocked in robots.txt. A sitemap contradicting your own canonical tags is a signal a crawler has to resolve, and it will not always resolve it your way.

Keep lastmod truthful. A file that stamps every URL with today's date, every day, teaches crawlers to ignore the field, and it is the one field that earns faster re-crawls when it is accurate. Regenerate after any structural change, and re-probe the links inside your content at the same time, since the change that moved those URLs moved them everywhere.

Then use the file as a diagnostic rather than a formality. Comparing the number of URLs you declare against the number actually indexed is one of the fastest reads available on whether a site has a crawl problem, a quality problem, or no problem at all.

A migration morning, replayed

The most expensive robots.txt mistakes happen on launch day, so it is worth replaying one. A site moves from staging to production. Staging carried User-agent: * followed by Disallow: / so that a half-built site never leaked into search results, which was correct. The launch copies the whole document root, the robots.txt comes along, and the new site goes live fully blocked. Nothing looks wrong. Pages load, analytics records visitors from social links, and the decline in search impressions over the following two weeks gets blamed on the redesign itself. On WordPress the same outcome ships as a single checkbox, Discourage search engines from indexing this site, ticked during development and never unticked.

The second launch-day classic is the permalink change. The site moves from /2023/05/post-name/ to /post-name/, the sitemap regenerates immediately and lists the new URLs, but Google's index still holds the old ones, every internal link written inside article bodies still points at them, and without redirects each one now returns a 404. The sitemap being correct does not fix any of that. The redirects have to be written, and until they are, the crawl budget is spent discovering that the old site is gone.

The third is the tidy-up rule. Disallow: /wp-content/ was once a common recommendation, and it blocks the theme's CSS and images along with whatever it was meant to hide. A crawler that cannot fetch the stylesheets evaluates an unstyled page, which can fail the mobile assessment on a site whose CSS is perfectly responsive. If a rule does not have a reason you can state in one sentence, it should not be in the file.

The whole class of mistake takes five minutes to rule out. Fetch /robots.txt and read every line aloud. Fetch /sitemap.xml and confirm it parses and lists the URLs that exist now. Pick five URLs from it at random and confirm each returns 200 rather than a redirect or an error. Confirm the Sitemap: line uses the absolute https URL. That is the entire check, and running it on launch morning is considerably cheaper than diagnosing it in a traffic graph three weeks later.

Questions

Do I need a sitemap if my site is small?

If every page is reachable within two or three clicks of your homepage and your internal linking is sound, a crawler will find everything without one, and a sitemap adds little. It is still worth having: it is nearly free to generate, it gives you a machine-readable inventory of what you think is on your site, and comparing that list against what is actually indexed is a useful diagnostic.

Is a missing robots.txt a problem?

No. A site with no robots.txt is treated as fully crawlable, which is usually what you want. A 404 for that path is completely fine. The dangerous states are a robots.txt that exists and blocks too much, or one that returns a server error, some crawlers treat a 5xx on robots.txt as a signal to back off entirely.

How often should the sitemap be regenerated?

Whenever content is published, unpublished or moved. Most CMS plugins do this automatically. The lastmod dates should be real, a sitemap that reports every page as modified today, every day, trains crawlers to ignore the field entirely, which removes the main benefit of having it.

Do I need to submit the sitemap to Google, or is the robots.txt line enough?

The Sitemap: line in robots.txt is the standard discovery mechanism and every major crawler reads it. Submitting the same URL in Search Console adds two things worth having: a faster first fetch, and the coverage report that tells you how many of the listed URLs Google actually indexed. Do both once; neither needs repeating unless the sitemap URL itself changes.

Do I need separate image, video or news sitemaps?

Only if you compete on those surfaces. The extensions exist so that a photography site can describe its images and a publisher can qualify for news carousels; for an ordinary content site, images inside your pages are discovered by crawling the pages, and a standard sitemap is enough. Add the specialised kind when you have the specialised content, not as a precaution.

Read more

This check also runs inside the technical SEO audit

Run it here on its own, or run the full audit to see this check scored alongside everything else that decides approval.

Open it