Introduction

A tablet and a card depicting a lighthouse on a clean desk

An XML sitemap is a standardized file listing a site's URLs to help search engines discover and index them. It is neither a navigation menu nor a site map for visitors: it is a technical document read by crawlers and governed by Sitemaps.

Before going further, here is what you can check right now:

  • Type votredomaine.com/sitemap.xml into your browser: the file should display, not a 404 error.
  • Check that the encoding is UTF‑8 (visible on the file's first line).
  • Submit the address in Google Search Console, in the Sitemaps section.
  1. Locate or generate your sitemap file.
  2. Validate its XML structure.
  3. Submit it and monitor the coverage report.

Key points

A well-structured XML sitemap, limited to 50 000 URLs and 50 MB per file, speeds up Google's discovery of pages without ever replacing a coherent site architecture.

PointDetails
Clear definitionAn XML sitemap lists URLs to be discovered and indexed, distinct from the HTML sitemap intended for visitors.
Respect official limitsEach file stays below 50 000 URLs and 50 MB; beyond that, use a sitemap index.
Ignore changefreq and priorityThese tags are hints that Google rarely follows; focus on lastmod.
Submit and monitorDeclare the file in robots.txt and Search Console, then monitor the coverage report.
Delegate the technical auditPharelia offers a free visibility audit that includes checking the sitemap and indexing.

Table of contents

What is an XML sitemap and what does it do for SEO?

An XML sitemap is a structured XML file listing the pages a site wants crawled and indexed. It differs from an HTML sitemap, which is designed for human visitors and displayed as a conventional navigation page: the XML sitemap is intended only for bots.

It has three main uses. It helps discover pages that may have few internal links connecting them. It allows you to prioritize certain URLs within the same site. It also communicates metadata: update dates, images, videos and local versions of a page.

But a sitemap fixes nothing by itself. Google will still struggle to understand a site with a confusing structure, even with a perfectly formed file: the sitemap is a safety net for discovery, not a substitute for coherent site architecture, as the protocol itself states in its official documentation.

  • Add only the URLs you genuinely want indexed.
  • Exclude noindex pages, duplicates and test environments.

Pro tip: a sitemap containing noindex pages or staging URLs sends a contradictory signal to Google. Clean the list before every submission rather than letting it grow automatically.

Which tags make up an XML sitemap file?

The format relies on a precise XML schema, with a mandatory namespace (xmlns), required UTF‑8 encoding and escaping of special characters in every URL, as required by the sitemaps.org protocol. A URL should not exceed 2 048 characters.

TagRole
<urlset>Root element containing all URL entries
<url>Block representing a single page
<loc>Full address of the page (required)
<lastmod>Last modification date, in year-month-day format (AAAA‑MM‑JJ)
<changefreq>Estimated update frequency (indicative)
<priority>Value indicating relative priority

changefreq and priority remain simple hints: Google largely ignores these two tags when deciding crawl frequency, contrary to what many people still believe.

The official limit to remember: each sitemap file must not exceed 50 000 URLs or 50 MB uncompressed. Beyond that, split it into several files and group them through a sitemap index.
  • Use gzip compression to reduce bandwidth consumed during crawling.
  • Check that the file remains valid XML before publication.

What does a valid XML sitemap look like?

Here is a minimal example conforming to the official schema:

<?xml version="1.0" encoding="UTF-8"?> <urlset xmlns="http://www.sitemaps.org/schemas/sitemap/0.9"> <url> <loc>https://www.exemple.com/</loc> <lastmod>2026-01-15</lastmod> </url> <url> <loc>https://www.exemple.com/produits/</loc> <lastmod>2026-02-03</lastmod> </url> </urlset>
  • The first line declares the XML version and UTF‑8 encoding, which is non-negotiable.
  • <urlset> carries the xmlns namespace defined by sitemaps.org: without it, the file is invalid.
  • Each <loc> contains the full URL, including the protocol and domain name.
  • <lastmod> follows the year-month-day format AAAA‑MM‑JJ; here, changefreq and priority have deliberately been omitted because they provide little real value.

Pro tip: always validate your file against an XSD schema before putting it online. A single closing-tag error can cause Google's entire processing operation to fail.

What technical rules and limits must you respect?

Ideally, the file should reside at the domain root, reference only URLs sharing the same host and protocol, and remain in UTF‑8 with correctly escaped entities. An official XSD schema lets you check conformity before submission.

In practical SEO terms, three habits prevent most errors:

  • Include only indexable pages consistent with your canonical tags.
  • Avoid uncleaned dynamic URLs (tracking parameters, sessions).
  • Update <lastmod> only when an actual content change has occurred.

The most common errors remain easily avoidable: an incorrectly entered path in Search Console, a robots.txt blocking access to the file, or listed URLs returning a 404. These exclusion best practices are documented and worth checking quarterly.

  1. Check file accessibility from a browser in private mode.
  2. Cross-check the sitemap's contents against your canonical tags.
  3. Compare the listed URLs with Search Console's coverage report.

Pro tip: for a site with more than a few thousand pages, use a sitemap index from the start rather than waiting to reach the 50 000 URL limit. Gzip compression then reduces the amount transferred at each crawl.

Should you create a sitemap index for a large site?

A sitemap index becomes necessary once you exceed 50 000 URLs or 50 MB, or when you want to separate content by type (products, images, articles, videos). It is a file referencing other sitemaps rather than individual URLs.

A dark tablet at the corner of a desk, next to a card illustrating a lighthouse.
<?xml version="1.0" encoding="UTF-8"?> <sitemapindex xmlns="http://www.sitemaps.org/schemas/sitemap/0.9"> <sitemap> <loc>https://www.exemple.com/sitemap-produits.xml</loc> <lastmod>2026-01-20</lastmod> </sitemap> <sitemap> <loc>https://www.exemple.com/sitemap-articles.xml</loc> <lastmod>2026-01-18</lastmod> </sitemap> </sitemapindex>

Each referenced sitemap must share the same host as the index, and an index can list up to 50 000 sub-sitemaps.

Pro tip: keep an up-to-date `<lastmod>` for every listed sub-sitemap: this lets Google know which file to recrawl first without reprocessing everything.

How can you generate and publish your sitemap for your platform?

The method depends entirely on your technical environment. On WordPress, plugins generate and update the file with every publication. On a custom-coded site, an in-house script or a tool such as XML‑Sitemaps.com performs the task as needed.

On Shopify, the question does not even arise: the platform automatically generates sitemap.xml as an index, with dynamically updated sub-sitemaps for products, collections and pages. On Webflow, the file is also generated automatically as soon as the site is published and is accessible at /sitemap.xml. In both cases, there is no need to write a custom file: simply check it exists and submit it.

  1. Identify whether your platform already generates the file automatically.
  2. Place the file at the domain root, or declare its path in robots.txt.
  3. Test public access: the page should return a 200 status code, not an error.
  4. Compress it as .gz if the file exceeds several thousand URLs.
  • For frequently updated sites, consider automatic regeneration through a deployment pipeline rather than manual updates.

How can you submit your sitemap and check indexing?

There are two main channels: declare a Sitemap: line in your robots.txt, and submit the file directly in Google Search Console (Sitemaps section) or Bing Webmaster Tools. Search Console then displays a status, Success or Error, along with the number of discovered URLs.

  1. Add Sitemap: https://votredomaine.com/sitemap.xml to robots.txt.
  2. Submit the same URL in Google Search Console and Bing Webmaster Tools.
  3. Consult the coverage report to identify errors (404, exclusions, blocks).
  4. Correct faulty URLs, then resubmit the file.
  • Regularly check changes in the number of indexed URLs against the number submitted: a large gap signals an access problem, duplicate content or a misplaced noindex directive.

Is the XML sitemap still relevant to AI answer engines?

Yes, and its role has even expanded. Extensions dedicated to images, videos and local content help not only Google index these resources, but also generative engines connect your visual content to their answers. This is an often underestimated point in image SEO: a well-written SEO alt tag is not enough if the image is never discovered, and an image sitemap fills precisely that gap. Choosing webp for your visuals, combined with an up-to-date image sitemap, increases the likelihood that a visual resource will appear in an AI-generated excerpt.

  • Prioritize lastmod and media metadata rather than manually adjusting changefreq and priority, which are largely ignored.
  • Document your technical choices using official Google Search Central resources rather than assumptions.

Pro tip: a well-structured SEO sitemap never replaces strong internal linking. It complements the architecture; it does not repair it.

An SEO consultant's view

Absolute priority: check public access to the file, submit it, then monitor Search Console every week rather than once a quarter. For the technical audit and implementation, the Pharelia team can take over.

Need a technical audit of your sitemap and indexing?

Pharelia is an alternative to the generalist agency that treats the sitemap as a box to tick: our free visibility audit cross-checks the technical crawl, Search Console report and sitemap consistency to identify precisely what is blocking indexing, rather than simply confirming that the file exists.

Pharelia

In practice, we check the presence and validity of the XML sitemap, coverage errors reported by Search Console, potential blocks in robots.txt and the consistency of host and canonicalization rules. This technical diagnosis is part of broader support that also covers AI search optimization: a clean sitemap helps discovery by Google, which remains the main entry point for generative engines such as ChatGPT or Perplexity. For online stores, our assessment of the Shopify sitemap and its automatic generation is part of the same audit. Contact us to find out exactly where your indexing obstacles lie.

Sources

Frequently asked questions

What exactly is an XML sitemap?

It is a structured XML file listing a site's URLs to help search engines discover them, following the official protocol.

How can you create an XML sitemap?

You can use a CMS plugin, an online generator such as XML‑Sitemaps.com, or let your platform (Shopify, Webflow) generate it automatically, then submit it in Google Search Console.

Is the sitemap.xml file still useful today?

Yes: Google continues to recommend XML for its flexibility, particularly through extensions dedicated to images, videos and local content, a role that has grown with AI answer engines.

How can you access an existing XML sitemap?

Add /sitemap.xml to the end of a site's address in your browser; if it does not exist there, check robots.txt, which often gives its exact path.

Can Pharelia help me check my sitemap?

Yes, Pharelia's free visibility audit includes checking the sitemap, robots.txt and coverage errors reported by Google Search Console.

Recommendation