What is an XML sitemap?

An XML sitemap is a machine-readable file that lists URLs a site wants search engines to discover. It can also describe updates and supported media or language relationships.

It is a curated discovery file, not necessarily an inventory of every address the website can generate. A private account page, a redirected URL and an indexable article do not belong in the same publishing list. Google’s sitemap overview explains its role.

Discovery is different from indexing

Sitemaps can help with large sites, newly launched sites with few external links, and media content. They do not guarantee crawling or indexing. A “submitted” URL has not thereby earned a place in search results.

Keep important pages reachable through internal links too. If a new article is missing from a category page, adding it to XML can disclose the address without fixing the reader’s navigation problem.

Read a basic sitemap entry

The following is an illustrative file with one example URL. Its namespace and required elements follow the Sitemaps protocol.

<?xml version="1.0" encoding="UTF-8"?>
<urlset xmlns="http://www.sitemaps.org/schemas/sitemap/0.9">
  <url>
    <loc>https://example.com/guides/booking/</loc>
  </url>
</urlset>

The urlset holds the list; each url contains a loc. Use UTF-8 and escape XML values. An ampersand inside a URL needs XML escaping, rather than being copied into the file unchanged.

Optional lastmod describes the linked page’s modification, not the moment the sitemap generator ran. Google ignores priority and changefreq; accurate lastmod should reflect significant page changes. Google’s XML guidance distinguishes these fields.

Sitemap formats and extensions

XML supports extensions for images, videos, news and localized page versions. Text sitemaps and RSS or Atom feeds are other supported formats, though a feed generally covers recent URLs. An HTML sitemap is a navigation page for people, a different task from this XML file.

Choose the format your publishing system can keep accurate. Extra tags create maintenance work when the underlying media or language mapping is unreliable.

When a sitemap index helps

The protocol limits an individual sitemap to 50,000 URLs and 50 MB uncompressed. Split files that exceed either limit; a sitemap index lists the child sitemap locations. Gzip can reduce transfer size but does not remove the uncompressed limit. The protocol’s index-file section specifies these limits.

Organizing child files by content type can also make investigation easier: an editor can inspect the article file while a catalog team checks products. That organization is a diagnostic choice, not evidence that every listed URL will be crawled.

Which URLs should you include?

Editorial sitemap selection
URL stateRecommended treatmentReason
Public, canonical page intended for searchInclude its preferred URLMatches the indexing intent.
Redirected or deleted addressUpdate the list after the changeThe address no longer represents the published page.
Private account or noindex pageExclude from the public indexing listDiscovery and indexing intent conflict.
Paginated category pageAssess the actual page and canonicalPagination alone does not establish duplication.

This is a publishing decision aid. Check actual responses, noindex directives and canonical choices before treating a generator’s output as final. Do not erase useful pagination merely because the URL contains a page number.

Keep the file accurate and discoverable

Use fully qualified URLs and prefer the site root for broad coverage. Make the file available through Search Console or a Sitemap: entry in robots.txt. Search Console submission is a discovery hint, not an obligation to crawl every address. Google’s submission instructions describe the options.

Update the publishing list when pages are added, retired or moved. Avoid resetting all modification dates on every build. Test the XML syntax and compare representative entries with the real page response and indexing intent.

Diagnose file errors separately from page problems

The Search Console Sitemaps report shows submitted files and processing issues. “Success” means Google processed the sitemap, not that every page is indexed. Use its indexing view and inspect affected pages to investigate exclusions.

URL Inspection can help test whether Google can fetch a resource; it is not a substitute for an XML schema validator. Repeated weekly resubmission is not a universal requirement: Google periodically revisits successfully read files.

Additional questions

Does the file have to be named sitemap.xml?

No. The address must be accessible and use a supported format. A familiar root-level path makes the file easier to find, but the filename itself does not provide a ranking advantage.

Should I include every URL my CMS exports?

Review the export against your publishing intent. Keep preferred public pages intended for search; exclude private pages, retired addresses and pages intentionally marked noindex.

Why is a listed page still missing from search?

A sitemap helps discovery. Inspect the page’s fetch result, indexing directives and canonical selection, then assess its content and links. Successful sitemap processing alone does not explain that page’s indexing decision.

Sources

Primary documentation accessed on 12 October 2026. Example scenarios are illustrative, not customer results.

Explore this topic: How to Create an XML Sitemap in 7 Steps (2026).