Guide

How to create an XML sitemap and submit it to Google

By Marcus B. Holzhauer · 15 October 2026 · Last updated on 16 October 2026

What a sitemap is

A file, usually at /sitemap.xml, that lists all the pages that should appear in search. It can optionally include the date of the last change.

Creating one

  • Most systems generate it automatically or through an add-on.
  • Include only pages that should be indexed: no error pages and no redirects.
  • For large websites, use several sitemaps.

Submitting it

  1. In Google Search Console, open the “Sitemaps” section.
  2. Enter the address of the sitemap and submit it.
  3. Check the status: were the pages found?

How a sitemap is structured

Each page sits in a url block, with its address in a loc element. The modification date lastmod is optional but useful if it is accurate: set it only for genuine changes to the content, not on every page view. Google says it does not use the priority and change-frequency values that appear in older tutorials. A single file may contain at most 50,000 addresses and be no larger than 50 MB (uncompressed); beyond that you need several files and a sitemap index file.

What belongs in it and what does not

  • Yes: pages with status code 200 that should be indexed and name themselves as the canonical.
  • No: redirects, error pages, pages with noindex, pages blocked by robots.txt and duplicates. If the sitemap contains such addresses, Search Console reports them, and the file becomes less meaningful.

An example of a typical fix

Suppose an online shop submits a sitemap with 4,000 addresses, but Search Console reports only about half of them as indexed. On inspection, many of the addresses turn out to be filter combinations whose canonical points to the category, and some products are sold out and redirect elsewhere. After the clean-up, the sitemap contains only categories and products that are in stock. The share of indexed pages does not rise automatically, but the figure becomes much more meaningful, and problems are easier to pinpoint.

Common mistakes

  • After a move, the sitemap still points to the old domain or the http version.
  • It can be opened in a browser but is blocked for crawlers by a plugin or a restriction.
  • It was created by hand once and never updated, so new pages are missing.
  • It exists but is not registered anywhere. Without an entry in robots.txt and Search Console, only someone who can guess the path will find it.

When it helps most

On small, well-linked websites, Google usually finds pages even without a sitemap. It becomes valuable for new websites with few external links, for very large sites and for pages that are poorly linked internally. It never replaces clean internal linking, though.

Checks after submitting

After submission, Search Console shows the status “Success” or lists problems, such as the file being unreadable. After a few days, check the number of pages discovered and compare it with the number you expected. If the two differ greatly, the cause is usually redirects, duplicates or blocked addresses. Repeat the check after every major overhaul of the website.

In addition

Add the sitemap to your robots.txt (a “Sitemap: …” line) so that other search engines find it too. A sitemap is not a ranking factor, but it helps make sure nothing is overlooked.

Questions about “How to create an XML sitemap and submit it to Google”?

Briefly describe your case; we will reply personally and honestly, even if the answer is “you don’t need that”. Our service for this: SEO & GEO.

Book an initial consultation