Skip to content
Innovialabs

How to Create an XML Sitemap and Submit It to Search Engines

Practice3 min

In short

An XML sitemap lists canonical, indexable URLs. Generate it with your CMS or framework, reference it in robots.txt and submit it in Google Search Console and Yandex Webmaster.

The short answer

A sitemap.xml is a file listing the pages you want in search results. It helps search engines discover new and updated URLs faster, especially on large sites and in poorly linked sections. The process: generate the sitemap, make sure it contains only the right pages, reference it in robots.txt and submit it in webmaster tools.

File format

A minimal sitemap looks like this:

<?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-01</lastmod>
  </url>
  <url>
    <loc>https://example.com/services/</loc>
  </url>
</urlset>

Key rules:

  • full absolute URLs with protocol;
  • UTF-8 encoding;
  • no more than 50,000 URLs and 50 MB uncompressed per file;
  • use lastmod only if it honestly reflects a content change.

Google ignores changefreq and priority, so there is no need to spend time on them.

What to include and exclude

IncludeExclude
Canonical pages returning 200Redirects and error pages
Pages open for indexingURLs with noindex or blocked in robots.txt
Key categories, products, articlesDuplicates, filters, sort parameters
All language versionsCart, account area, site search

The core principle: the sitemap must not contradict other signals. A URL in the sitemap that carries noindex is a mistake.

Index file for large sites

If you exceed the limit or want to split the sitemap by type, use a sitemap index:

<?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-products.xml</loc></sitemap>
</sitemapindex>

Splitting by type also makes diagnostics easier: webmaster tools show which section gets indexed worse.

Generating it in CMSs and frameworks

  • WordPress — the core built-in sitemap or SEO plugins (Yoast, Rank Math).
  • Bitrix, Tilda, Shopify — sitemaps are generated natively; enable and check them.
  • Next.js — an app/sitemap.ts file that returns an array of URLs pulled from a database or CMS.
  • Other frameworks — generator packages or your own endpoint that builds XML from the database.

The sitemap should update automatically when pages are published or removed, not be assembled by hand once a year.

Submitting to Google and Yandex

  1. Add a line to robots.txt: Sitemap: https://example.com/sitemap.xml.
  2. Google Search Console — the "Sitemaps" report; paste the sitemap URL.
  3. Yandex Webmaster — "Indexing" → "Sitemap files".
  4. A few days later, check the status: read errors and the number of discovered URLs.

Common mistakes

  • URLs use http instead of https, or a www variant that does not match the main host.
  • Pages with redirects and 404s are included.
  • lastmod changes on every build even though content did not.
  • The sitemap is blocked in robots.txt or returns a server error.

FAQ

No. It helps search engines discover pages, but they decide on indexing based on content quality and usefulness.

We can help with this

If you'd rather get the result than figure it all out yourself — this is what we do every day.

Discuss a project

Read next

Have an idea or a task? Tell us about it

We'll reply within one business day and propose a solution. The consultation is free.