What Is an XML Sitemap and Why Do You Need One?
An XML sitemap is a structured file that lists all the important URLs on your website, along with optional metadata like when each page was last updated, how often it changes, and its relative importance. Google reads this file when you submit it through Google Search Console and uses it to prioritize which pages to crawl. For large sites (thousands of pages), sitemaps help ensure all content gets crawled. For new sites, they solve a different problem: Google cannot discover your pages through links because you have none yet. A sitemap bypasses this by telling Google exactly where to look.
Creating a Sitemap for Different Site Types
Static HTML sites: manually list your URLs in the sitemap or use a generator tool to auto-crawl the site and produce the XML. WordPress: install a plugin like Yoast SEO, Rank Math, or Google XML Sitemaps. These generate and auto-update your sitemap at yoursite.com/sitemap.xml whenever you publish new content. Next.js: use the built-in sitemap support in App Router (app/sitemap.ts returns a sitemap array), or generate a static sitemap.xml file at build time. Shopify: automatically generates sitemap.xml at yourdomain.com/sitemap.xml — no action needed, just submit the URL to Search Console. For sites without a CMS or plugin, use the ToolMint Sitemap Generator to auto-crawl up to 1000 pages and download the ready-to-upload sitemap.xml file.
Sitemap XML Format: What Each Field Means
A valid XML sitemap has this structure: <?xml version="1.0" encoding="UTF-8"?> <urlset xmlns="http://www.sitemaps.org/schemas/sitemap/0.9"> <url> <loc>https://example.com/page/</loc> <lastmod>2026-01-15</lastmod> <changefreq>monthly</changefreq> <priority>0.8</priority> </url> </urlset> <loc> is required — it is the canonical URL of the page. <lastmod> is the date of last modification in YYYY-MM-DD format. <changefreq> hints how often the page changes (daily, weekly, monthly, yearly). <priority> indicates relative importance from 0.0 to 1.0 — the homepage is typically 1.0. Note that Google treats changefreq and priority as hints, not instructions.
How to Submit Your Sitemap to Google
Step 1: Upload sitemap.xml to your website root so it is accessible at https://yourdomain.com/sitemap.xml Step 2: Go to Google Search Console (search.google.com/search-console) Step 3: In the left sidebar, click Sitemaps Step 4: Enter the URL of your sitemap (just the path, e.g. sitemap.xml) and click Submit Step 5: Check back after 24–48 hours to see the Discovered URLs count and any errors in the Coverage report Also add the sitemap URL to your robots.txt file: Sitemap: https://yourdomain.com/sitemap.xml — this helps crawlers find it even without Search Console.