Sitemap: Format, Generation, Submission & Multilingual Configuration
If robots.txt tells search engines "where not to go," then sitemap tells them "what's worth seeing here." XML Sitemap is a list of pages you proactively submit to search engines, helping them discover your important content faster and more completely. This article covers format standards, generation, submission, and multilingual configuration to help you get sitemaps right and complete.
What is a Sitemap#
A sitemap is a file that lists important pages on your website, telling search engines which URLs are available for crawling. The most common form is XML Sitemap, which follows the sitemaps.org protocol and is supported by all major search engines.
It's important to distinguish between two easily confused concepts:
| Type | Audience | Purpose |
|---|---|---|
| XML Sitemap | Search Engines | Machine-readable URL list, helps crawling and indexing |
| HTML Sitemap | Users | Navigation page on the site for visitors to browse site structure |
This article focuses on XML Sitemap, which is a standard component of technical SEO.
Why You Need a Sitemap#
Search engines primarily discover pages through links. If your internal link structure is clear, theoretically crawlers can find all pages by following links. However, sitemaps provide clear value in these scenarios:
- Large websites: Huge numbers of pages make discovery via links inefficient, prone to missing deep pages.
- New websites: Few external links mean crawlers lack entry points—sitemaps accelerate initial indexing.
- Pages with sparse internal links: "Orphan" pages without sufficient internal links rely heavily on sitemaps for discovery.
- Frequently updated content: Use
lastmodto tell search engines which pages have updates, guiding prioritized re-crawling. - Rich media content: Images, videos, etc., can provide additional information through specialized sitemap extensions.
XML Sitemap Standard Format#
A standard XML Sitemap uses <urlset> as the root element, with each URL represented by a <url> entry:
<?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-06-24</lastmod>
</url>
<url>
<loc>https://example.com/about.html</loc>
<lastmod>2026-06-20</lastmod>
</url>
</urlset>
Tag Descriptions
| Tag | Required | Description |
|---|---|---|
<loc> | Yes | Full absolute URL of the page, must be XML-escaped (e.g., & as &) |
<lastmod> | No | Last modification time, W3C date format (e.g., 2026-06-24). Google references it when accurate |
<changefreq> | No | Update frequency hint. Google ignores this |
<priority> | No | Relative priority (0.0–1.0). Google ignores this |
loc and accurate lastmod. If lastmod is inaccurate (e.g., changed to current date on every build), Google will gradually stop trusting it.Size Limits and Sitemap Index#
Single sitemap files have two hard limits:
- Maximum 50,000 URLs
- Uncompressed file size under 50MB
When exceeding limits, split into multiple sitemaps and organize with a sitemap index file using <sitemapindex> as the root element:
<?xml version="1.0" encoding="UTF-8"?>
<sitemapindex xmlns="http://www.sitemaps.org/schemas/sitemap/0.9">
<sitemap>
<loc>https://example.com/sitemap-articles.xml</loc>
<lastmod>2026-06-24</lastmod>
</sitemap>
<sitemap>
<loc>https://example.com/sitemap-products.xml</loc>
<lastmod>2026-06-22</lastmod>
</sitemap>
</sitemapindex>
Even without exceeding limits, splitting by content type (articles, products, categories, etc.) is good practice: it lets Search Console coverage reports show indexing status by type, making it easier to locate issues. A single sitemap index file can reference up to 50,000 sitemaps.
sitemap.xml.gz). The 50MB limit applies to uncompressed size, so compression primarily saves transfer bandwidth. Large sitemaps should be compressed.Extension Types: Images, Videos, News#
Beyond standard sitemaps, specialized extension namespaces exist for specific content types, providing additional metadata.
| Extension | Namespace Purpose | Use Case |
|---|---|---|
| Image Sitemap | Declare image information on pages | Sites where images are core content (galleries, e-commerce) |
| Video Sitemap | Provide video duration, thumbnail, title, etc. | Sites with video content wanting video search results |
| News Sitemap | Provide publication time, title, etc. | News sites already included in Google News |
Using image sitemap as an example, embed image information within <url> entries:
<urlset xmlns="http://www.sitemaps.org/schemas/sitemap/0.9"
xmlns:image="http://www.google.com/schemas/sitemap-image/1.1">
<url>
<loc>https://example.com/gallery.html</loc>
<image:image>
<image:loc>https://example.com/photo-1.webp</image:loc>
</image:image>
</url>
</urlset>
Multilingual Sitemap and hreflang#
Multilingual websites can directly declare language version relationships in sitemaps—one of three ways to configure hreflang (the others being HTML <link> tags and HTTP response headers). Configuring in sitemap offers centralized management and easier bulk maintenance.
The approach uses xhtml:link elements to list all language versions (including itself) for each URL:
<urlset xmlns="http://www.sitemaps.org/schemas/sitemap/0.9"
xmlns:xhtml="http://www.w3.org/1999/xhtml">
<url>
<loc>https://example.com/zh/about.html</loc>
<xhtml:link rel="alternate" hreflang="zh"
href="https://example.com/zh/about.html"/>
<xhtml:link rel="alternate" hreflang="en"
href="https://example.com/en/about.html"/>
<xhtml:link rel="alternate" hreflang="x-default"
href="https://example.com/en/about.html"/>
</url>
</urlset>
Note: This site currently only has a Chinese version, but the directory structure (/articles/zh/...) already accommodates multilingual expansion—when other languages are added, hreflang relationships can be seamlessly added to the sitemap.
How to Generate Sitemaps#
Depending on website scale and tech stack, several mainstream approaches exist for generating sitemaps:
| Method | Use Case | Description |
|---|---|---|
| CMS Plugins | WordPress, etc. | Yoast SEO, Rank Math, etc. auto-generate and maintain |
| Framework Built-in | Next.js, Astro, Hugo, etc. | Auto-generated at build time, syncs with pages |
| Online Tools | Small static sites | Crawl site to generate, one-time or periodic manual updates |
| Build Scripts | Custom static sites | Iterate page files, automatically output XML |
For a pure static site like MagicSEO, the most reliable approach is a build script: iterate the articles directory, read each page's path and file modification time, and automatically output sitemap.xml. This way, the sitemap auto-updates when new articles are added—nothing gets missed, and lastmod stays accurate.
How to Submit Sitemaps#
After generating your sitemap, you need to let search engines know it exists. Two main methods are recommended—do both:
1. Declare in robots.txt
Add a Sitemap directive to robots.txt, and all supported crawlers will automatically discover it:
User-agent: *
Disallow:
Sitemap: https://example.com/sitemap.xml
2. Submit in Google Search Console
- Log in to Google Search Console and select your property (site).
- In the left menu, click "Sitemaps".
- In the "Add a new sitemap" input, enter your sitemap path (e.g.,
sitemap.xml) and click Submit. - After submission, wait for Google to process—status will show "Success" with the number of URLs discovered.
Bing Webmaster Tools has a similar submission process. No need to resubmit repeatedly—as long as the sitemap content updates, search engines will re-crawl it on their own schedule.
For more details, see Google Official Documentation: Build and Submit Sitemaps.
Monitoring in Search Console#
After submission, Search Console's "Sitemaps" report and "Pages" (Indexing) report help you monitor sitemap health:
- Read status: Confirm sitemap can be successfully read with no parsing errors or accessibility issues.
- Discovered URLs: Compare with expected page count—large gaps indicate omissions or format issues.
- Coverage: In the "Pages" report, filter by "Submitted via sitemap" to see how many are indexed vs. excluded and why.
Pay close attention to "submitted but not indexed" pages—this usually points to content quality, duplication, or canonical issues, not sitemap problems themselves.
Common Errors#
| Error | Consequence | Fix |
|---|---|---|
| Including noindex / blocked URLs | "Submitted but excluded" warnings, reduced trust | Only include indexable canonical URLs |
| Using relative URLs | Invalid sitemap or parsing failure | <loc> must be full absolute URLs |
| Unescaped URLs | Parsing errors (especially parameter URLs with &) | Write & as & |
| Fake lastmod (changed every time) | Google stops trusting lastmod | Update only when content actually changes |
| Mixing non-canonical versions | Canonical signal conflict | Only include canonical version of each content |
| Forgetting to update sitemap for new pages | Delayed discovery of new pages | Use scripts/plugins for auto-generation |
This Site's Sitemap Strategy#
MagicSEO is a pure static content site with page scale in the hundreds, well below the 50,000 limit, so a single sitemap file suffices:
<?xml version="1.0" encoding="UTF-8"?>
<urlset xmlns="http://www.sitemaps.org/schemas/sitemap/0.9">
<url>
<loc>https://magic-seo.com/</loc>
</url>
<url>
<loc>https://magic-seo.com/articles/en/technical-seo/sitemap.html</loc>
<lastmod>2026-06-24</lastmod>
</url>
</urlset>
articles/ directory: it only indexes final pages returning 200, lastmod comes from actual file modification time, and all URLs are absolute paths matching canonical URLs. The sitemap URL is declared in robots.txt and submitted in Search Console. The directory structure is language-layered (/zh/, /en/), enabling seamless hreflang addition when expanding multilingual support.Configuration Checklist#
- sitemap.xml accessible via absolute URL, returns 200
- Only contains indexable canonical URLs (200, allowed for indexing, canonical points to self)
- All loc entries are full absolute URLs and XML-escaped
- lastmod accurately reflects content modification time
- Single file doesn't exceed 50,000 URLs / 50MB, otherwise use sitemap index
- Doesn't include changefreq / priority (Google ignores them)
- Sitemap URL declared in robots.txt
- Submitted in Google Search Console
- Multilingual sites have hreflang configured bidirectionally
- Sitemap auto-updates when new pages are added
Frequently Asked Questions#
Do small websites need a sitemap?
If your website only has a few dozen pages with a clear internal link structure, Google can typically discover all pages on its own, making a sitemap less critical. However, submitting a sitemap does no harm: it accelerates discovery of new pages, helps Google understand page update times, and provides index coverage reports in Search Console. For most websites, providing a sitemap is recommended practice.
Are pages in sitemap guaranteed to be indexed?
Not necessarily. A sitemap only helps search engines discover URLs—it is a discovery signal, not an indexation guarantee. Whether a page gets indexed still depends on accessibility, indexability, content quality, and canonical signals. Adding a URL to your sitemap won't make a low-quality or noindex page get indexed.
How many URLs can a single sitemap file contain?
A single sitemap file can contain up to 50,000 URLs and must be no larger than 50MB when uncompressed. If you exceed these limits, you need to split into multiple sitemap files and organize them with a sitemap index file.
Are changefreq and priority tags still useful?
Google has explicitly stated that it ignores changefreq and priority tags, instead determining page update frequency and importance based on actual crawl data. If accurately maintained, the lastmod tag is still referenced by Google. Therefore, modern sitemaps typically only require loc and accurate lastmod—no need to worry about changefreq and priority.