XML Sitemaps: What They Do, What to Include, and How to Maintain One
A practical, sourced guide to canonical URLs, sitemap fields, submission, maintenance and what an XML sitemap cannot guarantee.
XML Sitemaps: What They Do, What to Include, and How to Maintain One
An XML sitemap is a file that lists canonical URLs on a website for search engines. It can help crawlers discover pages, especially when a site is new or its navigation makes some pages difficult to find. A sitemap is a discovery hint: it does not guarantee that a URL will be crawled, indexed, or rank in search results. Google recommends linking pages through ordinary navigation and useful internal links as well as providing a sitemap. See Google’s sitemap overview.
What belongs in a sitemap?
List the important, canonical pages that you want search engines to consider. A URL should generally be publicly accessible, return a successful response, and represent the preferred version of that page. Do not use the sitemap to promote duplicate query-string variants, redirect destinations, pages blocked from crawling, or pages marked noindex.
For a small site, one XML file may be enough. Larger sites can split URLs among several sitemap files and provide a sitemap index that links to them. Google documents a limit of 50,000 URLs or 50 MB (uncompressed) per sitemap file. If a site has language-specific versions, include the appropriate hreflang annotations using the supported sitemap format or on-page tags.
A minimal example
Each URL entry needs a <loc> with an absolute URL. <lastmod> is optional; when included, it should reflect a real, significant page update rather than the time the sitemap was regenerated.
<?xml version="1.0" encoding="UTF-8"?>
<urlset xmlns="http://www.sitemaps.org/schemas/sitemap/0.9">
<url>
<loc>https://example.com/</loc>
<lastmod>2026-10-16</lastmod>
</url>
<url>
<loc>https://example.com/products</loc>
</url>
</urlset>
The changefreq and priority elements are part of the sitemap protocol, but Google ignores them. They are not a way to request faster crawling or boost rankings. lastmod can be useful when it is accurate and consistently reflects meaningful changes. Google’s sitemap best practices explain which fields it uses.
How to publish and maintain it
- Generate the sitemap from the same source of truth as the site’s routes or content records. This reduces the risk of forgotten pages and outdated URLs.
- Check that every listed URL is canonical and returns the page you expect. Remove URLs that redirect, return errors, or should not appear in search.
- Make the sitemap available at a stable URL, commonly
/sitemap.xml, and reference it inrobots.txtwith an absolute URL. - Submit the sitemap in Google Search Console if you use it. Submission helps Google discover the file; it does not guarantee indexing.
- Keep the sitemap current when pages are added, removed, or materially changed. After removing an indexed page, choose the appropriate redirect or
404/410response rather than leaving an obsolete sitemap entry.
Google also recommends hosting a sitemap at the site root when possible, using UTF-8, and keeping each file within the documented size limits. See Google’s instructions for building and submitting a sitemap.
Sitemaps do not replace site structure
A sitemap helps crawlers find URLs; it does not make a thin, misleading, duplicate, or inaccessible page useful to visitors. Keep the main navigation clear, group related material into sensible sections, and link relevant articles together. Visitors should be able to find the same important pages without relying on a crawler-only file.
On ArkDevLabs, the XML sitemap points to language-specific sitemap files. If you find an outdated URL in one of them, please let us know through the contact page.