Lesson 9 / 32

Sitemap.xml

Create and submit a sitemap to tell search engines about all your pages and their importance.

What is a sitemap?

A sitemap.xml is an XML file that lists every page on your site, along with metadata like last modified date and priority. It's not for users; it's for search engines. It helps crawlers discover pages they might otherwise miss.

Sitemap structure

Each URL in the sitemap includes the location, last modified date, change frequency, and priority (0.0–1.0). Simple format, big impact.

<?xml version="1.0" encoding="UTF-8"?>
<urlset xmlns="http://www.sitemaps.org/schemas/sitemap/0.9">
  <url>
    <loc>https://example.com/</loc>
    <lastmod>2025-10-15</lastmod>
    <changefreq>weekly</changefreq>
    <priority>1.0</priority>
  </url>
  <url>
    <loc>https://example.com/blog</loc>
    <lastmod>2025-10-14</lastmod>
    <changefreq>weekly</changefreq>
    <priority>0.9</priority>
  </url>
  <url>
    <loc>https://example.com/blog/seo-guide</loc>
    <lastmod>2025-10-01</lastmod>
    <changefreq>monthly</changefreq>
    <priority>0.8</priority>
  </url>
  <url>
    <loc>https://example.com/about</loc>
    <lastmod>2025-09-20</lastmod>
    <changefreq>yearly</changefreq>
    <priority>0.7</priority>
  </url>
</urlset>

Submit to Search Console

After creating your sitemap, submit it via Google Search Console (and Bing Webmaster Tools). This speeds up crawling and indexing.