Before a Content Launch, Check Every Child URL in Your Sitemap Index

Audit child sitemaps and their page URLs before launch. Check redirects, canonical targets, crawl access, XML errors, and stale or missing pages.

Published
Reading time
8 min read
Before a Content Launch, Check Every Child URL in Your Sitemap Index
On this page

A sitemap index can point to many child sitemap files, each containing hundreds or thousands of page URLs. Before launch, check both layers: whether every child file can be fetched and parsed, and whether every listed page is the canonical destination you intend to publish.

This workflow shows how to build that inventory, identify stale or blocked URLs, and reconcile the results against your launch list. It covers XML sitemaps in detail; other supported formats need format-specific extraction.

Key Takeaways

  • A successful response from the index does not prove its child sitemaps or their page URLs are valid.
  • Compare every sitemap URL with an authoritative list of intended canonical URLs. A redirect or a conflicting canonical declaration needs investigation.
  • Check crawling and indexing signals separately from HTTP reachability. No sitemap submission guarantees indexing.
  • Record redirects, cross-host locations, XML errors, and crawler-specific access issues before launch.

Start with the index and its child files

Treat the sitemap index as the top-level manifest. Its <loc> entries identify child sitemap files; a child XML sitemap's <loc> entries identify page URLs. Sitemap files may be compressed with gzip.

For each child listed in the index, record:

  1. The URL exactly as listed and the HTTP status returned when fetching it.
  2. Any redirect chain and the final sitemap URL.
  3. Whether the final response is the expected sitemap content and parses successfully.
  4. The number of entries and a list of the page URLs, retaining the source child sitemap for each entry.

A redirected child sitemap may still be retrievable, but update the index to the intended final sitemap URL where appropriate. Investigate redirect loops, unexpected hosts, login pages returned with a successful status, and files that return an error or HTML instead of a sitemap.

Check host and size constraints

Review the host of the index, each child sitemap, and each page URL separately. A cross-host child or page URL is not necessarily acceptable merely because your own HTTP client can fetch it. Sitemap submission method, host scope, and verified ownership can affect whether Google accepts it. Check the applicable sitemap protocol and Google Search Central guidance for your exact setup, especially when a CDN, separate sitemap host, or multiple domains are involved.

The commonly cited limits are 50,000 entries and 50 MB uncompressed per sitemap file or sitemap index. Check the current applicable documentation before relying on those figures, including how limits apply to compressed files and your chosen format. Split oversized files and ensure the index lists every resulting child.

Research limitation: Google Search Central and the sitemap protocol documentation were not available to consult for this article. Confirm current format support, cross-host rules, and limits in those primary sources before launch.

Advertisement

Extract and reconcile XML sitemap URLs

The following small utility extracts <loc> values from a locally saved XML sitemap index or XML URL sitemap. It uses Python's standard library, accepts gzip-compressed files by their file signature, and limits the uncompressed input it reads. Use it only on files from sources you trust; it is not a hardened parser or a complete sitemap validator. The example has not been executed here.

Save it as extract_sitemap.py:

import gzip
import sys
import xml.etree.ElementTree as ET
from pathlib import Path

NS = "{http://www.sitemaps.org/schemas/sitemap/0.9}"
MAX_BYTES = 50 * 1024 * 1024


def read_file(path: Path) -> bytes:
    with path.open("rb") as raw:
        compressed = raw.read(2) == b"\x1f\x8b"

    opener = gzip.open if compressed else open
    with opener(path, "rb") as source:
        data = source.read(MAX_BYTES + 1)
    if len(data) > MAX_BYTES:
        raise ValueError("uncompressed file exceeds the local 50 MiB limit")
    return data


def main() -> int:
    if len(sys.argv) != 2:
        print("Usage: python extract_sitemap.py FILE", file=sys.stderr)
        return 2

    try:
        root = ET.fromstring(read_file(Path(sys.argv[1])))
        if root.tag == NS + "sitemapindex":
            entry_tag = NS + "sitemap"
        elif root.tag == NS + "urlset":
            entry_tag = NS + "url"
        else:
            raise ValueError("not a supported XML sitemap index or URL sitemap")

        locations = []
        for entry in root.findall(entry_tag):
            loc = entry.find(NS + "loc")
            if loc is None or not loc.text or not loc.text.strip():
                raise ValueError("an entry has no loc value")
            locations.append(loc.text.strip())

        for location in locations:
            print(location)
        return 0
    except (OSError, EOFError, ValueError, ET.ParseError) as exc:
        print(f"Cannot extract sitemap: {exc}", file=sys.stderr)
        return 1


if __name__ == "__main__":
    raise SystemExit(main())

After saving the fetched index as sitemap-index.xml, extract its child locations:

python extract_sitemap.py sitemap-index.xml > child-sitemaps.txt

Fetch each listed child using your normal authorized crawl or download process, retaining a mapping from the listed URL to the saved file and its response details. Run the same utility on each saved XML child. Preserve the child-to-page mapping in your inventory rather than merging the results immediately. A nonzero exit or an invalid XML error is a launch issue to investigate, not an empty sitemap.

This utility extracts locations; it does not check schema validity, URL syntax, entry counts, host eligibility, or whether a child is improperly another index. It also does not process text sitemaps or RSS/Atom feeds. Google supports multiple sitemap formats, but confirm the applicable format and submission rules in its current documentation; use a format-aware extractor for non-XML children. A feed may cover only a subset of your site, so do not assume it is a complete launch inventory.

For XML, pay particular attention to an incorrect namespace, malformed tags, and unescaped characters such as & in query strings. XML escaping changes the file representation, not the intended URL.

Check every page against the intended canonical list

Create a launch inventory from your CMS, publishing system, or another authoritative source. Include the intended canonical URL and publication status for each page. Compare it with the union of extracted page URLs, while keeping the original child sitemap as an audit column.

For every sitemap URL, check:

  1. Is it expected? Flag URLs absent from the launch inventory, removed products or articles, old campaign pages, staging hosts, and duplicate entries across child files.
  2. Does it respond as intended? Request the URL and record its status, redirect chain, final URL, and content type. Investigate errors, redirect loops, unexpected login responses, and pages that return a successful status with an error page.
  3. Is it the canonical destination? Compare the exact sitemap URL with the intended canonical URL. Inspect the HTML canonical link or applicable HTTP Link header, resolving relative canonical targets against the page URL. Flag a redirect or canonical declaration pointing elsewhere, and investigate missing, multiple, or conflicting declarations. A canonical declaration is a signal, not proof that a search engine will select that URL.
  4. Can the intended crawler access it? Check applicable robots.txt rules for the relevant crawler, plus authentication, firewall, and bot-management behavior. Test the actual URL and user agent; a browser or generic HTTP client may receive a different response.
  5. Are indexing directives compatible? Inspect response headers such as X-Robots-Tag and relevant HTML robots meta tags for noindex or conflicting directives. If crawling is blocked, a crawler may not be able to see a page-level directive; do not treat a blocked page as a verified indexable page.

Use exact URLs for the initial comparison, including scheme, host, path, trailing slash, and query string. Do not silently normalize away differences: some differences change the resource or redirect behavior. Investigate fragments and unexpected tracking parameters rather than treating them as distinct canonical pages by default.

Also compare in the other direction: an intended launch URL missing from all child sitemaps may be a publishing or sitemap-generation problem. Prioritize discrepancies affecting launch-critical pages, but keep a complete exception list with an owner and resolution.

Advertisement

Run the checks safely at site scale

Use a crawler or HTTP-checking workflow that can export one row per URL, including the source sitemap, status, final URL, redirect chain, canonical target, crawl restrictions, and indexing directives. Verify that the tool actually captures each field; a status checker alone cannot establish canonical intent or indexability.

For a single URL on a site you own or are authorized to test, this command follows redirects and discards the response body while displaying response headers. Replace the example URL with your own:

curl -sS -L --max-redirs 5 --max-time 30 -D - -o /dev/null -- 'https://www.example.com/page/'

Review the headers for every response in the chain, not just the first. A separate HTML inspection is needed for canonical links and meta robots directives. Use GET when checking page content; a HEAD response alone may not reflect the behavior of a normal page request.

At scale, limit concurrency and request rates, set timeouts and response-size limits, and coordinate with operations before testing production. Retry transient failures cautiously and retain timestamps and error details. Test the launch environment under the conditions intended for search crawlers: authentication, temporary noindex, staging hostnames, and firewall rules often change at release time. Re-run affected checks after those changes.

Common Mistakes

  • Checking only the index: A valid index can still list missing, malformed, or outdated child files.
  • Treating a 200 response as indexability: The response can be a login page, soft error, duplicate, noindex page, or a page inaccessible to the intended crawler.
  • Following redirects without recording them: The final response can hide a stale sitemap or a page URL that is not the intended canonical destination.
  • Ignoring host boundaries: Successful fetching does not establish that a cross-host sitemap setup meets a search engine's submission requirements.
  • Trusting one snapshot: Sitemap generation, publication state, and access controls can change between the audit and launch.

Best Practices

Keep the intended canonical inventory under the same change control as the launch. Generate sitemaps from published, intended canonical URLs where possible, and compare counts and exceptions after regeneration. Review failures and conflicting signals, then repeat the audit after deployment and monitor the relevant search engine's sitemap and URL inspection reports.

Search engines choose whether and when to index URLs. Sitemap inclusion, a successful response, and favorable checks help expose eligible pages; none guarantees indexing or a particular ranking.

Conclusion

Audit the index, every child file, and every listed page as separate layers. Reconcile the resulting URLs with your intended canonical inventory, fix access and indexing conflicts, and repeat the checks when launch settings change.

What would your domain sell for?

A free TidyURLs account unlocks the Domain Estimator. It prices a name from 191,011 real domain sales.