XML sitemap: how to configure it correctly in 2026
A badly configured XML sitemap can stop Google from indexing half of your website without you knowing. You therefore need to know how to configure it properly, submit it to Search Console and avoid the common pitfalls.
Contents
What an XML sitemap is really for
An XML sitemap is a file in XML format that lists all the URLs of your website that you want Google to index. It serves three main purposes:
- Helping Google discover your pages faster, especially deep or new pages
- Providing metadata such as the last modification date, the priority and the change frequency
- Declaring the language versions of the same page via hreflang (essential for multilingual websites)
Without a sitemap, Google discovers your pages through internal and external links. With a sitemap, it discovers them through 2 channels (sitemap + links), which speeds up indexing and reduces the number of forgotten pages.
For a website with fewer than 50 pages and good internal linking, the sitemap is a secondary concern. For a website with 100+ pages, an active blog or a multilingual site, it is a must.
The format of a standard XML sitemap
Here is a basic XML sitemap:
<?xml version="1.0" encoding="UTF-8"?>
<urlset xmlns="http://www.sitemaps.org/schemas/sitemap/0.9">
<url>
<loc>https://voren.ch/</loc>
<lastmod>2026-06-20</lastmod>
<changefreq>weekly</changefreq>
<priority>1.0</priority>
</url>
<url>
<loc>https://voren.ch/services/referencement-seo/</loc>
<lastmod>2026-06-20</lastmod>
<changefreq>monthly</changefreq>
<priority>0.8</priority>
</url>
</urlset>
The important elements:
<loc>: the full URL, in HTTPS, in its canonical version (with or without a trailing slash, but consistent everywhere)<lastmod>: the date of the last modification in ISO 8601 format (YYYY-MM-DD)<changefreq>: the change frequency (always, hourly, daily, weekly, monthly, yearly, never). Note: Google has largely ignored this field since 2018.<priority>: relative priority between 0.0 and 1.0. Note: Google has also ignored this field since 2018.
In practice, only <loc> and <lastmod> matter. The other two are kept for compatibility but have no real impact.
A sitemap for a multilingual website (hreflang)
If your website is multilingual (Voren’s is, in French, English, German and Italian), the sitemap must include the hreflang tags for each URL.
<?xml version="1.0" encoding="UTF-8"?>
<urlset xmlns="http://www.sitemaps.org/schemas/sitemap/0.9"
xmlns:xhtml="http://www.w3.org/1999/xhtml">
<url>
<loc>https://voren.ch/services/referencement-seo/</loc>
<xhtml:link rel="alternate" hreflang="fr-CH" href="https://voren.ch/services/referencement-seo/"/>
<xhtml:link rel="alternate" hreflang="en" href="https://voren.ch/en/services/seo-agency-switzerland/"/>
<xhtml:link rel="alternate" hreflang="x-default" href="https://voren.ch/services/referencement-seo/"/>
</url>
</urlset>
x-default indicates the default version when no language matches. For Voren, it is the French version.
Common mistake: forgetting the hreflang tags or setting non-reciprocal ones. If the FR page points to EN, the EN page must point back to FR. Without reciprocity, Google ignores the hreflang tags and indexes only one version.
A sitemap index for large websites
Beyond 50,000 URLs or 50 MB, you must split your sitemap into several files and create a sitemap index that references them.
<?xml version="1.0" encoding="UTF-8"?>
<sitemapindex xmlns="http://www.sitemaps.org/schemas/sitemap/0.9">
<sitemap>
<loc>https://voren.ch/sitemap-services.xml</loc>
<lastmod>2026-06-20</lastmod>
</sitemap>
<sitemap>
<loc>https://voren.ch/sitemap-journal.xml</loc>
<lastmod>2026-06-20</lastmod>
</sitemap>
<sitemap>
<loc>https://voren.ch/sitemap-projects.xml</loc>
<lastmod>2026-06-20</lastmod>
</sitemap>
</sitemapindex>
Good practice: split by content type (service pages, journal, projects) rather than into arbitrary chunks. This lets you monitor each type separately in Search Console.
Automatic vs manual generation
Manual (to be avoided): editing sitemap.xml by hand for every new page. You always end up forgetting a page, and the file goes out of date.
Automatic, through the CMS:
- WordPress: Yoast SEO, Rank Math or All in One SEO handle it automatically
- Astro:
@astrojs/sitemapgenerates it at build time - Next.js: the
next-sitemappackage - Shopify: generates it automatically
- Custom: generate it in the CI/CD pipeline
At Voren, every website we deliver generates its sitemap automatically on each build, with no human intervention.
Submitting to Google Search Console
Once your sitemap is publicly accessible (typically at https://yoursite.com/sitemap.xml), you need to submit it to Google.
- Go to https://search.google.com/search-console
- Select your property (your website)
- Left-hand menu → Sitemaps
- Add a new sitemap:
sitemap.xml - Submit
Google will read the sitemap, identify the URLs and gradually crawl them. In Search Console, you can see:
- The status of the sitemap (Success / Error)
- The number of URLs discovered
- The number of URLs indexed (it may be lower, which is normal)
Repeat this for the language variants (sitemap-fr.xml, sitemap-en.xml) if you have split them. For a sitemap index, submit only the index: the sub-sitemaps are discovered automatically.
Bing Webmaster Tools
Bing accounts for 3 to 5% of search traffic in French-speaking Switzerland in 2026, a small share that still counts.
Submitting to Bing: go to https://www.bing.com/webmasters, add your website and submit the sitemap. The set-up is equivalent to Search Console, and simpler.
Common mistakes to avoid
Mistake 1 · Non-canonical URLs. The sitemap must list the canonical version of each URL (HTTPS, a consistent trailing slash, www or not). Mixing versions confuses Google.
Mistake 2 · 404 URLs in the sitemap. A sitemap containing URLs that return a 404 tells Google that your website is poorly maintained. Regenerate the sitemap every time you delete a page.
Mistake 3 · Noindex URLs in the sitemap. A URL with <meta name="robots" content="noindex"> in the sitemap sends a contradictory signal. Remove noindex pages from the sitemap.
Mistake 4 · A lastmod that is never updated. If all your URLs have <lastmod>2024-01-15</lastmod>, Google will consider that no page has changed for 18 months. Generate the lastmod automatically on every change.
Mistake 5 · Pages blocked by robots.txt in the sitemap. If your robots.txt blocks /admin/, do not put /admin/ URLs in the sitemap: the signal would be contradictory.
Mistake 6 · No hreflang on multilingual websites. Hreflang is mandatory to avoid cannibalisation between language versions.
Mistake 7 · Forgetting to update after a redesign. During a redesign, many URLs change. The sitemap must reflect the new URLs, and the 301 redirects are ideally declared in the site’s code, outside the sitemap.
Validation and debugging
Free tools to validate your sitemap:
- Google Search Console: reports errors at the time of submission
- XML Sitemap Validator: https://www.xml-sitemaps.com/validate-xml-sitemap.html
- Screaming Frog (free < 500 URLs): compares your sitemap with your actual website and identifies the gaps
Checks to run after every major deployment:
- The sitemap is publicly accessible (HTTP 200)
- The sitemap is valid XML
- All the URLs in the sitemap return 200 (no 404 or 301 in the sitemap)
- The hreflang tags are reciprocal
What we do at Voren
Every Voren website generates its sitemap automatically on each build via @astrojs/sitemap. The hreflang tags are generated from Astro’s i18n system. The lastmod is taken automatically from the file dates in Git. The sitemap is submitted to Search Console and Bing Webmaster from the initial deployment.
For websites with an editorial journal, a dedicated sitemap, /journal-sitemap.xml, makes monitoring easier. For multilingual websites, there is one sitemap per locale with a root index.
Going further
If your existing website has no sitemap, or if you suspect it is badly configured:
Request a free technical audit: a check of your sitemap, hreflang and Search Console indexing, with corrective recommendations. 7 days, no obligation.
See our SEO package for French-speaking Switzerland: a technical audit included in every retainer, sitemap optimisation included.