Skip to main content
SEO

XML Sitemap

Published:
Updated:

An XML sitemap is a file listing the site URLs that should be indexed, together with metadata, primarily the last modification date (lastmod). The format is defined by the sitemaps.org protocol, supported by all major search engines.

A sitemap does not guarantee indexing. It is a discovery channel. It brings the most value on sites that are large, newly launched, poorly interlinked or frequently changing, where a bot might not reach pages within a reasonable time.

Protocol versus indexing recommendations

  • Protocol limit: 50,000 URLs and 50 MB (52,428,800 bytes) uncompressed per file; split larger sets and reference them from a sitemap index.
  • Indexing recommendation: preferred, indexable 200 URLs. An XML parser does not verify status, canonical selection or absence of noindex.
  • Optional lastmod reflects significant changes to page content, structured data or links, not every build. Google ignores priority and changefreq.
  • Declare the sitemap URL in robots.txt or submit it in Search Console; these are discovery methods, not mandatory XML fields.

Special sitemaps

Beyond the standard page sitemap there are extensions for images, video and news, as well as sitemaps with hreflang annotations for language versions. In practice, sitemap generation should be automated and tied to the content publishing cycle.

Example

A minimal sitemap with two URLs: only canonical addresses returning 200, with a real lastmod date.

XML
<?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-07-01</lastmod>
  </url>
  <url>
    <loc>https://example.com/pricing</loc>
    <lastmod>2026-06-15</lastmod>
  </url>
</urlset>
Declaration in robots.txt
Example
Sitemap: https://example.com/sitemap.xml

Escaping and URL scope

Use absolute URLs and UTF-8. Escape & as &amp; in XML independently of URL encoding. By default, keep one host and the scope appropriate to the sitemap location; publishing for other hosts requires the search engine’s cross-site verification and configuration.

A two-parameter URL, if it is preferred
XML
<loc>https://example.com/catalog?category=books&amp;language=pl</loc>

Sources & further reading

Check your site's technical quality

Insight analyses public SEO, performance, accessibility and security signals and turns findings into an ordered action list.