A sitemap is a file with links to a site’s pages that tells search engines about its current structure. The main format is XML: Google calls it the most versatile, while Yandex supports both XML and a plain text file. A sitemap helps search engines find pages, but it doesn’t mean all of them will be crawled and get into search. More on why a page from the sitemap might not make it into search — in a separate article.
Below — which addresses to include in the sitemap, how the file is structured and what its limits are, how to tell Yandex and Google about it, and how to find and fix errors.
What a sitemap.xml file is and why you need one
How search engines use a sitemap
Crawlers find new pages by following links from pages they’ve already processed. A sitemap gives them another source of addresses: in it, the owner lists the pages they want to appear in search themselves.
At the same time, a sitemap is a hint, not a command. Google states outright that a Sitemap file is only a hint for search engines: having one doesn’t mean Google will download the file or use it for crawling pages.
A sitemap doesn’t replace navigation and links between pages: the crawler finds addresses through them during a normal crawl, and a visitor moves between sections through them. On why a sitemap doesn’t replace internal links — a separate article.
Does your site need a sitemap
Google and Yandex describe the cases where a sitemap is useful slightly differently.
- Google recommends a sitemap if the site is large; if it was created recently and few external links point to it; if it has a lot of video and image content, or is featured in Google News.
- Yandex recommends using a Sitemap if the site has a large number of pages, has individual pages with no navigational links, or has deep nesting.
Google also lists signs that a sitemap might not be needed: the site is relatively small — no more than 500 pages that should be in search — it has a thorough internal linking system, and relatively few media files and news pages. That’s Google’s wording; Yandex’s help has no such caveat.
The practical takeaway: if a sitemap already exists on the site, keep it up to date and consistent with canonical and robots.txt. An outdated sitemap with extra addresses is a source of conflicting signals, not help.
XML sitemap and HTML sitemap: what’s the difference
The term «sitemap» is used for two different things.
| XML sitemap (sitemap.xml) | HTML sitemap | |
|---|---|---|
| For whom | For crawlers | For visitors |
| Format | An XML file following the Sitemap protocol’s rules | A regular site page with links to sections |
| Where it’s located | A separate file, for example /sitemap.xml | A page within the site’s structure, usually linked from the footer |
| What it provides | Tells search engines the list of addresses | Helps a person find the section they need |
From here on, this article is only about the XML sitemap: it’s the one you add to Yandex Webmaster and Google Search Console. An HTML sitemap is just a regular navigation page, and this article’s rules don’t apply to it.
Which pages to include in a sitemap, and which not to
Google advises adding the URLs you want to see in search results to the Sitemap file. If the same content is available at multiple addresses, only the primary version should go into the sitemap. Yandex also recommends determining canonical URLs for the pages that will be listed in the file.
From this comes a practical rule: the sitemap should contain only canonical addresses that can be indexed and that return a 200 code.
Include:
- canonical (primary) versions of pages — as a full absolute address, with the same protocol and host as the site;
- pages that should be in search: sections, product cards, articles, service pages.
Don’t include:
- Non-canonical duplicates and addresses with parameters (sorting, filters, tags). The sitemap should contain the primary address. If the address in the sitemap diverges from canonical and the internal links, the search engine gets conflicting signals. More — what a canonical address is.
- Pages with noindex. Noindex is a directive that disallows indexing a page. If such a page is in the sitemap, you’re simultaneously offering it to the search engine and disallowing its indexing.
- Addresses blocked in robots.txt. You’ve disallowed the crawler from accessing them yourself, and the sitemap is proposing to crawl them anyway. Check which addresses robots.txt rules block before assembling the sitemap.
- Redirects and addresses with 404 and 5xx errors. Put the final address in the sitemap — one that opens and returns a 200 code.
- Addresses on a different domain or subdomain. Under the protocol, all the addresses in one file must belong to the same host; Yandex asks that you list links only from the domain where the file itself is located.
File format: tags, requirements and limits
What a sitemap.xml file looks like
A minimal sitemap for a sample site https://example.com/:
<?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-09-28</lastmod>
</url>
<url>
<loc>https://example.com/services/</loc>
<lastmod>2026-09-15</lastmod>
</url>
<url>
<loc>https://example.com/blog/first-article/</loc>
</url>
</urlset>
The first line declares XML and the UTF-8 encoding. The <urlset> element wraps all the addresses and points to the protocol standard. Each page is described in a <url> block: <loc> holds its address, <lastmod> the date it was last changed.
Required and optional tags
| Tag | Required | What it means | Yandex | |
|---|---|---|---|---|
<urlset> | Yes | The file’s root element, referencing the protocol standard | — | — |
<url> | Yes | A block holding one page’s data | — | — |
<loc> | Yes | The page’s address | — | A required tag |
<lastmod> | No | The last-modified date in W3C Datetime format | Uses it when the value is accurate | An optional tag: «the date the page was last updated» |
<changefreq> | No | How often the page changes | Ignores it | An optional tag: «how frequently the page changes» |
<priority> | No | The page’s relative importance, from 0.0 to 1.0 | Ignores it | An optional tag; the crawler accounts for whether the coefficient is present and its value |
The key one here is <lastmod>. Per Google, it should hold the date of the page’s last significant change: updates to the main content, structured data or links. Updating the year in a copyright line doesn’t count as a significant change. So update <lastmod> only on real page changes, rather than stamping every address with the date the file was rebuilt.
Requirements for the file
- UTF-8 encoding — required by the protocol, Google and Yandex alike.
- Full absolute addresses:
https://example.com/page/, not/page/. - One host and the right location. A file applies to its own directory and the ones nested in it: a sitemap at
/catalog/can only contain addresses from/catalog/. Google recommends placing the file at the site’s root so it covers the whole site. - Escaping special characters. Tag values are escaped as in any XML — for example,
&in an address is written as&. - Address length. Under the protocol, an address in
<loc>must be shorter than 2,048 characters. Yandex’s overall limit is also 2,048 characters: 1,024 for the domain name and 1,024 for the page path.
Limits and the sitemap index file
A single Sitemap file is capped at 50,000 addresses and 50 MB uncompressed. These limits are stated the same way by the protocol, Google and Yandex. The file can be gzip-compressed, but the size limit is counted uncompressed.
If there are more addresses, split the sitemap into several files and list them in a sitemap index file. An index file can list up to 50,000 sitemap files:
<?xml version="1.0" encoding="UTF-8"?>
<sitemapindex xmlns="http://www.sitemaps.org/schemas/sitemap/0.9">
<sitemap><loc>https://example.com/sitemap-pages.xml</loc></sitemap>
<sitemap><loc>https://example.com/sitemap-blog.xml</loc></sitemap>
</sitemapindex>
Having several sitemap files on one site is normal. It’s convenient to split them by page type — sections and the blog separately, for example.
Other formats and extensions
Besides XML, there’s a text format: a plain file with addresses, one per line. Both Google and Yandex support it. RSS 2.0 and Atom 1.0 feeds are accepted as a sitemap by Google; Yandex’s help names only XML and TXT.
Using the Sitemap extensions Google supports, an XML sitemap can carry additional information about images, videos and news, as well as localized page versions. The syntax for the extensions is described in Google’s documentation.
How to create a sitemap
The way you create one depends on how the site is built. You usually pick one of three routes:
- A CMS feature or module. The sitemap updates itself when pages are published. The risk: the module includes everything it finds, including utility pages, tags and archives, unless you exclude them in the settings.
- An external generator. A program crawls the site via links and collects the addresses it finds. The upside — no need for access to the code. The risk: the generator collects whatever it found, including duplicates, addresses with parameters and redirects, while skipping pages with no links. A file like this also goes stale after every site change.
- A script or a database export. A developer writes code that rebuilds the file on changes. The upside — full control over its contents. The risk: the address-selection rules need to be maintained alongside the site.
In many CMS platforms, the sitemap is generated automatically — in that case, check the resulting /sitemap.xml.
Whichever method you choose, check the resulting file against the rule from the «Which pages to include» section: canonical addresses, no noindex, redirects or errors. And make sure the sitemap gets rebuilt after releases and migrations.
How to tell search engines about the sitemap
Place the file on the site
The file must open at its own address: Yandex requires that the server return HTTP code 200 (OK) when the file is requested. Place the sitemap on the same domain as the site — ideally at the root. Often this is https://example.com/sitemap.xml, but the file name can be different.
The Search Console help advises checking the file’s accessibility to Google with the URL Inspection tool.
A Sitemap line in robots.txt
You can tell both systems about the sitemap through robots.txt: specify the sitemap’s address there as a full URL.
Sitemap: https://example.com/sitemap.xml
Google accepts such a line anywhere in the file, and there can be any number of Sitemap lines. Yandex also suggests pointing to the file’s address in robots.txt. The rest of the file’s syntax is covered in the article on how a robots.txt file is structured.
Yandex Webmaster
In Webmaster, a sitemap is added under «Indexing» → «Sitemap files»: select the site, enter the file’s address, and click «Add.» After that, the crawler regularly checks the file for updates and errors.
Google Search Console
Search Console has a Sitemaps report: you paste the file’s address into it and click «Submit.» You can submit a sitemap through the report only if you have owner rights on the property. For automation, there’s the Search Console API.
How to check a sitemap
How to find a sitemap
- Open
https://your-site/sitemap.xml— this is a common, but not mandatory, address. - Look at the
Sitemap:line in the/robots.txtfile — it holds the sitemap’s actual address. - For your own site — open the «Sitemap files» section in Webmaster and the Sitemaps report in Search Console: they show every submitted file and its status.
The Sitemaps report in Search Console
For each submitted file, the report shows a processing status:
| Status | What it means | What to do |
|---|---|---|
| «Success» | The file was received and processed with no errors | Check the list of addresses against the «canonical, indexable, 200» rule |
| «Has errors» | The file was received and partly processed, but contains errors | Open the file in the report, review the errors, fix them, and resubmit |
| «Couldn’t fetch» | Google couldn’t fetch the file | Check that the file opens at the address given and isn’t blocked from the crawler |
If you delete the file from the report, it disappears from the list, but Google will remember both the file itself and the addresses it listed. If those addresses shouldn’t be processed, the help suggests disallowing access to them in robots.txt, deleting the file or the pages from the site, or adding a noindex rule.
Sitemap files and analysis in Yandex Webmaster
In the «Sitemap files» section, Webmaster shows the status of each file, for example «OK,» «Redirect,» «Error» or «Not indexed.»
You can check a file before submitting it with the «Sitemap files analysis» tool: it checks the contents against Yandex’s requirements. You can check a file by link, upload it, or paste it as text; the tool lists any errors found. Error names and descriptions are collected in Webmaster’s error reference — for example, «HTTP error,» «Incorrect encoding,» «Invalid XML,» «Number of URLs exceeds the specified limit,» «Incorrect lastmod tag value.»
The checking sequence is: open the file, check it in Webmaster and Search Console, then compare a sample of addresses against the «canonical, indexable, 200» rule. If a specific page from the sitemap isn’t in search, look into it separately — there’s a dedicated article on how to find the cause when a page isn’t in the index.
Checklist for a correct sitemap:
- The file opens, returns a 200 code, and is saved in UTF-8.
- It contains only absolute canonical addresses on one host and protocol.
- There are no addresses with noindex, redirects, 4xx / 5xx errors, or ones blocked in robots.txt.
<lastmod>only changes when the page actually changes.- The file is no more than 50,000 addresses and 50 MB uncompressed, or split via an index file.
- Special characters in addresses are escaped.
- The sitemap is listed in robots.txt and added to Webmaster and Search Console.
- The sitemap has been rebuilt after a release or migration.
Common sitemap errors and how to fix them
| Error | What it risks | How to fix it |
|---|---|---|
| Non-canonical addresses, duplicates, the same address listed twice | The sitemap doesn’t contain the addresses you want to see in search | Keep only the primary version of each page |
| Addresses with noindex or blocked in robots.txt | The sitemap contradicts your own restrictions | Remove such addresses from the sitemap, or lift the restriction if the page should be in search |
| Redirects, 404, 5xx | The sitemap contains addresses that don’t open as pages | Replace them with the final addresses that return a 200 code; remove deleted pages |
| Wrong protocol, host or subdomain (http instead of https, addresses with and without www) | The one-host-and-domain requirement is violated | Bring all addresses to the site’s primary mirror |
Relative addresses (/page/) | The requirement for full absolute URLs is violated | Give the full address, with protocol and domain |
| Unescaped characters, wrong encoding | The file doesn’t parse as XML; Webmaster will show an error | Escape the values, save the file in UTF-8 |
| More than 50,000 addresses or 50 MB in one file | The limit is exceeded | Split the sitemap and connect the parts via an index file |
<lastmod> set to the file-rebuild date for every address | Google uses the value only if it’s accurate | Set the date of the page’s actual change |
| The sitemap is outdated after a release or migration | The file has old addresses, and no new ones | Rebuild the sitemap and resubmit it in Search Console |
Such mismatches can appear after releases and migrations, when addresses and templates change. If you need to check the sitemap together with the rest of the crawl settings, see how a check of the sitemap, robots.txt and server responses works as part of technical SEO. If you need an assessment of the entire technical foundation, an SEO audit that checks the technical foundation is a good fit.
Frequently asked questions
Where is the sitemap located, and how do you open it?
The sitemap often lives at /sitemap.xml at the site’s root, but the file name can be anything. The exact address is usually given in the Sitemap: line of the robots.txt file. More in the «How to find a sitemap» section.
Can you have several sitemap files?
Yes. robots.txt can list several Sitemap: lines, and large sitemaps are split into parts and listed in an index file.
Do you need to specify changefreq and priority?
For Google — no: it ignores the values of these tags. In Yandex’s help, both tags are optional; for priority it says the crawler takes into account whether the coefficient is present and its value when fetching pages.
Do you need a sitemap if the site has few pages?
Google writes that a small site — up to 500 pages that should be in search — with a thorough internal linking system and few media files may not need a sitemap. Yandex has no such caveat. If a sitemap already exists, keep it in order.
Do you need to resubmit the sitemap after every change?
No. Google processes the file on its regular crawl schedule, and recommends resubmitting it after significant changes that need to be processed faster. Yandex’s crawler regularly checks the file for updates on its own.
Sources
Documentation the article relies on (checked October 6, 2026):
- Google Search Central: Learn about sitemaps; Build and submit a sitemap.
- Sitemaps.org: Sitemaps XML format.
- Search Console help: Sitemaps report.
- Yandex Webmaster help: Using a Sitemap file (in Russian); Sitemap files (in Russian); Sitemap files analysis (in Russian); Reference for Sitemap processing errors (in Russian).
Did your sitemap drift away from the real addresses after a release or migration? We’ll check the sitemap, robots.txt and canonical together and suggest what to fix. → Discuss technical SEO
If you need a check of the whole technical foundation, not just the sitemap, you can start with an SEO audit.