Skip to content
SEOL

XML sitemaps

A sitemap lists the canonical URLs you want search engines to know about. Generate it automatically, keep it clean, and use lastmod honestly.

Time
14 min
Level
intermediate
Reviewed
5 November 2026

After this lesson you can

  • Build a valid sitemap that lists only canonical, indexable URLs.
  • Use sitemap index files and lastmod correctly.
  • Submit sitemaps and read the Sitemaps report.

A sitemap is a file that lists the URLs you want search engines to discover. It does not force crawling or indexing. Google calls it a hint, and treats sitemap inclusion as a weak canonical signal. It helps most on large sites, new sites with few links, and sites with pages that are poorly linked internally.

What a good sitemap contains

<?xml version="1.0" encoding="UTF-8"?>
<urlset xmlns="http://www.sitemaps.org/schemas/sitemap/0.9">
  <url>
    <loc>https://example.com/paslaugos/remontas/</loc>
    <lastmod>2026-10-28</lastmod>
  </url>
</urlset>

Only list URLs that:

  • return 200,
  • are not noindexed,
  • are their own canonical,
  • are not blocked by robots.txt.

Generate, do not hand-write

Sitemaps should come from the same data that builds your pages, so they update automatically:

  • PrestaShop: the Google sitemap module (gsitemap), with regeneration scheduled after catalogue changes.
  • WordPress: core serves /wp-sitemap.xml. SEO plugins replace it with their own.
  • Shopify: generated automatically at /sitemap.xml.
  • Next.js: app/sitemap.ts. SEO-L itself does this, and keeps its sitemap empty while the site is noindexed.

Submitting

  1. Search Console, then Sitemaps: submit the sitemap or sitemap index URL.
  2. Add a line to robots.txt: Sitemap: https://example.com/sitemap.xml.
  3. Bing Webmaster Tools: submit it there too, or import from Search Console.

The Sitemaps report shows when Google last read the file, its status, and how many URLs it discovered. Open the "Pages" view from a sitemap to see the indexing status of just those URLs. That is a quick way to check your important pages.

Special sitemaps

  • Image sitemaps can list images, including images hosted on other domains such as a CDN.
  • Video and news sitemaps exist for those content types.
  • Hreflang in sitemaps: language alternates can be listed in the sitemap instead of in the HTML (covered in the international SEO lesson).

Practice

Read the lesson, pass the quiz and do the exercise to complete it.

Knowledge check

4 questions. Get at least 4 right to pass.

  1. 1. Which URLs belong in a sitemap?
  2. 2. How does Google treat priority and changefreq?
  3. 3. When is lastmod used?
  4. 4. A sitemap has 80,000 URLs. What do you do?

Exercise: Audit your sitemap

Open your sitemap, or sitemap index, in a browser. Count the URLs. Check a sample of 20 with a crawler, or with the page inspector, for status code, noindex and canonical. Then check the Sitemaps report in Search Console for its status and the date it was last read.

Deliverable: A note with the sitemap URL, its URL count, any URLs that should not be there (non-200, noindex, canonicalised elsewhere), whether lastmod looks accurate, and the Search Console status. Record problems in the Issues tab.

Check your work honestly against each point
Write up your work and meet every point to finish.

Sources

Checked against these sources on 5 November 2026. Next review by 5 May 2027.

Terms

Checklist items

Tools