Skip to content
arduralab
·13 min

Sitemap.xml — how to submit to Google and speed up crawl [2026]

sitemapGoogle Search Consoleindexingtechnical SEOcrawl
MG
Marcin Godula

Współzałożyciel & Head of SEO/Tech

Specjalista SEO, GEO i web development z ponad 15-letnim doświadczeniem. Pomaga firmom B2B budować widoczność w wyszukiwarkach klasycznych i AI.

Sitemap.xml is a file listing the URLs a site owner wants a search engine to know about. It helps Google discover those URLs, but it does not guarantee they will be crawled or indexed. Google accepts a sitemap in three ways: through the Sitemaps report in Search Console, through the Search Console API, or through a Sitemap: line in robots.txt. Of the sitemap fields, Google reads the URL (loc) and the last-modified date (lastmod) when it is trustworthy; it ignores priority and changefreq.

Submitting a sitemap is the easy part. What happens after the submission — whether Google crawls the URLs and whether it decides to index them — is the real subject of this tutorial, not the number of ways to click "submit."

TL;DR — Sitemap.xml in Google in 6 points

#WhatDetails
1. FormatUTF-8 XML, at most 50,000 URLs or 50 MB uncompressedfull, absolute URLs
2. LocationSite root recommended, e.g. /sitemap.xmla sitemap in a subdirectory covers only that directory unless you submit it in Search Console
3. SubmissionSearch Console → Sitemapsalso the Search Console API and a Sitemap: line in robots.txt
4. LastmodDate of the last significant content changeGoogle uses it if it is consistently accurate
5. Sitemap indexWhen a sitemap exceeds the limits, or to split by sectionup to 50,000 sitemaps in one index
6. ContentsCanonical URLs only, status 200, no noindexno 4xx errors, redirects or blocked URLs

Source for the limits and rules in this table: Google's documentation on building and submitting a sitemap.


What is sitemap.xml

A sitemap is an XML file listing the URLs on a site that the owner wants a search engine to discover. According to Google's sitemaps overview, a sitemap is most useful for large sites, new sites with few external links, and sites with a lot of video, image or news content. A small site — Google's rough guide is about 500 pages or fewer — that is well connected through internal links may not need one, although a sitemap will not hurt it.

What sitemap does NOT do

MythReality according to Google
"Sitemap will index my URLs"A sitemap does not guarantee that all its URLs will be crawled and indexed
"More URLs in the sitemap is better"A sitemap should list the URLs you want in search results, not every URL that exists
"Sitemap increases ranking"A sitemap helps with discovery; Google does not describe it as a ranking factor
"After submission, Google fetches the sitemap right away"Submission is only a hint and does not even guarantee the sitemap will be downloaded

What sitemap DOES do

  1. Lists URLs directly — Google does not have to discover every page through internal links alone
  2. Hints at crawl scheduling — Google treats a trustworthy lastmod as a signal when scheduling recrawls of URLs it already knows
  3. Describes language versions — a sitemap with xhtml:link elements is one of three ways to mark up language versions (hreflang), alongside HTML tags and HTTP headers (Google's documentation on localized versions)
  4. Provides diagnostics — the Sitemaps report in Search Console shows whether the sitemap was fetched and how many URLs Google read from it

None of these four jobs is "get indexed." A sitemap can do all of them correctly while the rest of the work — content, internal linking, server health — still has to happen elsewhere.


How to submit a sitemap to Google

Method 1: Sitemaps report in Search Console

  1. Open Google Search Console and select the property
  2. In the left menu, choose Sitemaps
  3. Enter the sitemap URL (most often /sitemap.xml) and click Submit
  4. Check the sitemap's status in the same report

You only need to submit once — after that, Google comes back to the sitemap on its own. The Search Console API does the same thing programmatically, which helps when you manage many sites.

Method 2: Sitemap line in robots.txt

In the robots.txt file at the domain root:

User-agent: *
Allow: /

Sitemap: https://example.com/sitemap.xml
Sitemap: https://example.com/blog-sitemap.xml

The Sitemap: line can be read by other search engines too, not only Google. It is optional — submission through Search Console works without it — and it is not a Search Console submission, so it will not give you a status report for the sitemap.

Ping endpoint: deprecated, don't use it

Sitemaps used to be "pinged" with https://www.google.com/ping?sitemap=.... On June 26, 2023, Google announced the deprecation of this endpoint and said it would stop working six months later (Google Search Central blog post). You will still see it in old tutorials — skip it and use Search Console or robots.txt instead.

IndexNow: for other search engines, not for Google

IndexNow is an open protocol a site uses to notify search engines about added, updated and deleted URLs. According to the project's website, it is supported by Microsoft Bing and Yandex, among others, and a submission sent to one participating engine is shared with the others. Google is not listed as a participant. IndexNow can complement your sitemap for other search engines, but it does not replace it. How to implement it and what to watch for is covered in our article on submitting changed URLs with IndexNow.


Sitemap.xml format — example

<?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://example.com/en/blog/article</loc>
    <lastmod>2026-05-01T10:30:00+02:00</lastmod>
    <xhtml:link rel="alternate" hreflang="pl" href="https://example.com/blog/artykul"/>
    <xhtml:link rel="alternate" hreflang="en" href="https://example.com/en/blog/article"/>
  </url>
</urlset>

Fields — what counts for Google

FieldDoes Google use it?Note
locYesfull canonical URL returning status 200
lastmodYes, if it is trustworthydate of the last significant content change
changefreqNoGoogle ignores it
priorityNoGoogle ignores it
xhtml:linkYeslanguage version markup

Practical conclusion: loc + lastmod + optionally xhtml:link for language versions. You can drop changefreq and priority — in its 2023 post, Google wrote that it still doesn't use them at all.

When should lastmod change? According to the same post, when the main content, the structured data or the links on the page have changed. A minor change in a sidebar or footer is not a reason to update the date, and Google stops relying on dates that don't match reality.


Sitemap index for large sites

Limits of a single sitemap

  • at most 50,000 URLs
  • at most 50 MB uncompressed — gzip reduces the transfer size, but the limit applies to the uncompressed file

A larger sitemap has to be split into several and tied together with a sitemap index (Google's documentation on large sitemaps).

Sitemap index structure

<?xml version="1.0" encoding="UTF-8"?>
<sitemapindex xmlns="http://www.sitemaps.org/schemas/sitemap/0.9">
  <sitemap>
    <loc>https://example.com/sitemap-blog.xml</loc>
    <lastmod>2026-05-03</lastmod>
  </sitemap>
  <sitemap>
    <loc>https://example.com/sitemap-services.xml</loc>
    <lastmod>2026-05-01</lastmod>
  </sitemap>
  <sitemap>
    <loc>https://example.com/sitemap-glossary.xml</loc>
    <lastmod>2026-04-29</lastmod>
  </sitemap>
</sitemapindex>

An index can list up to 50,000 sitemaps, and the sitemaps it points to must be on the same site, in the same directory or below it. Search Console accepts up to 500 sitemap index files per site.

When to use a sitemap index

  • when a sitemap exceeds 50,000 URLs or 50 MB — then splitting is mandatory
  • on sites with clear sections (blog, store, glossary) — separate sitemaps make diagnosis in Search Console easier
  • in online stores with many categories — a separate sitemap per group of categories
  • on a small site, one sitemap is usually enough

Sitemap index in Next.js and Astro

  • Next.js: a sitemap.ts file with a generateSitemaps function lets you split the sitemap into several files
  • Astro: the @astrojs/sitemap integration creates an index file and splits the sitemap into parts

7 most common errors (and how to fix them)

None of these errors is exotic. They are easy to miss because the sitemap "looks fine" until you check what is actually inside it.

1. Noindex URLs in the sitemap

Problem: The sitemap presents a page as a URL to show in search results, while a noindex directive says not to index it. Those are contradictory signals.

Fix: Filter in the sitemap generator — exclude URLs with noindex in <meta name="robots"> or in the X-Robots-Tag header. Quick check: curl -s URL | grep "noindex".

2. 4xx/5xx URLs in the sitemap

Problem: The sitemap contains URLs returning 404 (deleted), 410 (permanently gone) or 500.

Fix: Check the HTTP status of every sitemap URL before deploying. Example script:

while read url; do
  status=$(curl -o /dev/null -s -w "%{http_code}" "$url")
  echo "$status $url"
done < <(curl -s https://example.com/sitemap.xml | grep -oP '(?<=<loc>)[^<]+')

3. Stale lastmod (always the same date)

Problem: lastmod is set to the same timestamp for every URL on each deploy, even though only a few pages changed. Google stops trusting dates like that.

Fix: A per-URL lastmod with the real date of the last significant content change — for example from frontmatter or from git log --format=%aI -1 -- file.mdx.

4. Sitemap over the limits

Problem: The sitemap has more than 50,000 URLs or is over 50 MB uncompressed.

Fix: Split it into several sitemaps and tie them together with a sitemap index. Gzip alone does not solve the problem, because the limit applies to the uncompressed size.

5. No hreflang in a multilingual sitemap

Problem: The site has PL and EN versions, the sitemap is the only place where language versions are marked up, and the entries have no xhtml:link.

Fix: According to Google's documentation, each language version must point to all versions, including itself. If you mark them up in the sitemap, the generator has to add the full set of xhtml:link elements to every URL.

6. Canonical URL contradicting the sitemap

Problem: The sitemap contains URL_A, but the page has <link rel="canonical" href="URL_B">. Google usually shows canonical URLs in search results, so the sitemap entry points to a different URL from the one that should appear.

Fix: Put the canonical URL in the sitemap, not a variant of it. Check: curl -s URL | grep canonical and compare it with the URL in the sitemap.

7. Sitemap not refreshing on deploy

Problem: The CDN keeps an old copy of the sitemap in cache for a long time, so after new posts go live the crawler gets an outdated file.

Fix: A short cache lifetime for the sitemap (e.g. Cache-Control: max-age=300) or purging the CDN cache for sitemap files on every deploy.


How to monitor your sitemap

Sitemaps report in Search Console

  • Status — whether Google fetched and read the sitemap, or hit an error
  • Discovered pages — how many URLs Google read from the sitemap
  • Last read — when Google last fetched the sitemap

Page indexing report in Search Console

The Page indexing report shows which URLs are indexed, which are not, and why (Search Console Help). You can filter it to the URLs from a specific sitemap. Two statuses come up most often with sitemaps:

  • Discovered – currently not indexed — Google found the page but hasn't crawled it yet
  • Crawled – currently not indexed — Google crawled the page but did not index it

For the first status, check whether the server responds quickly and whether internal links lead to those pages. For the second, look at the content itself first, and at whether the page duplicates another one. The Indexing API is not the answer here: according to Google, it is meant only for pages with job postings and livestream videos.

By this stage the sitemap is rarely the problem — it has already done its job of getting the URL noticed. What's missing is usually upstream: content quality, internal linking or server performance.


FAQ — most common questions

Can I have multiple sitemaps for the same property?

Yes. You can submit several sitemaps independently — for example sitemap.xml, blog-sitemap.xml and news-sitemap.xml. With more of them, the simplest option is a sitemap index linking to all of them; Search Console accepts up to 500 sitemap index files per site.

What about <image:image> and <video:video>?

These are sitemap extensions for images and video. They are useful for sites with a lot of original images (online stores, galleries) or video. For a typical blog they are optional.

Does sitemap.xml work for AI crawlers?

A sitemap is a search engine standard. In its guide to generative AI features, Google says you don't need to create any new AI-specific files, such as llms.txt, to appear in them, and that Google Search doesn't use them (Google's guide). How other AI companies' crawlers use sitemaps is up to those companies.

Should old URLs stay in the sitemap after a 301 redirect?

A sitemap should list the URLs you want in search results, meaning the destination canonical URLs that return status 200. A URL that redirects to them doesn't meet that condition, so after a migration your current sitemap should contain the new URLs.

Does the sitemap need to be static or can it be dynamically generated?

It can be generated dynamically (e.g. with sitemap.ts in Next.js or an Astro integration). What matters is that it contains current URLs and trustworthy lastmod dates, however it is produced.

What is priority and should I use it?

priority (0.0–1.0) declares how important a page is relative to others. Google doesn't use this field, and in its 2023 post it called it highly subjective. You can leave it out.


What's next

Resubmitting a technically valid sitemap will not change how Google treats its URLs. Work through the checklist below in order:

  1. Check your sitemap now — curl -s https://example.com/sitemap.xml | head -20 and count the URLs: curl -s ... | grep -c "<loc>"
  2. Go through the 7 errors above and fix each one you find
  3. Submit the sitemap in Search Console if you haven't yet
  4. Read more:

Get an SEO audit

Your sitemap lists hundreds of URLs, and the Page indexing report shows that many of them never make it into the index? Get an SEO audit — we check the sitemap, canonical URLs, noindex directives, internal linking and what Search Console says about the pages that aren't indexed. You get a list of concrete fixes, ordered by what to change first.

Terms from this article

Need help with this topic?

Get a free audit and find out how we can help your business grow online.

Get a free quote