Do you need a sitemap?
Search engines find most pages by following links. A sitemap helps when a site is new and has few links pointing in, when it is large, when pages are not well linked internally, or when content changes often. For a small, well-linked site it is not essential, but it is cheap insurance and it gives you indexing reports in Search Console.
What to include
List only the canonical, indexable pages you want in search results: URLs that return a normal 200 response, are not set to noindex, and are the preferred version of each page. Leave out redirects, error pages, login and cart pages, internal search results and URLs with tracking parameters.
The format
<?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-11-01</lastmod>
</url>
</urlset>
locis the full URL, and is required.lastmodis the date the page's content last changed. Google uses it when it is consistently accurate, so do not set it to today's date on every page by default.changefreqandpriorityare optional; Google has said it ignores them.- Special characters such as
&must be escaped. A generator handles this for you.
Each sitemap file can hold up to 50,000 URLs and 50 MB uncompressed. Bigger sites split their URLs across several files and list those files in a sitemap index.
Three ways to create one
Your CMS or SEO plugin
WordPress has a built-in sitemap at /wp-sitemap.xml, and SEO plugins usually add their own. Shopify, Squarespace, Wix and similar platforms generate sitemaps automatically; check their help pages for the exact address.
From a list of URLs
For hand-built or static sites, paste your page list into the XML sitemap generator. It removes duplicates, escapes characters, adds lastmod if you want, and splits large lists into files plus an index.
A crawler
Desktop SEO crawlers can scan your site and export a sitemap. This finds pages you forgot, but also pages you may not want listed, so review the output.
Upload and submit
- Upload
sitemap.xmlto your site, usually at the root:https://example.com/sitemap.xml. Open it in a browser to check. - Add a line to your robots.txt:
Sitemap: https://example.com/sitemap.xml. Our guide on writing robots.txt shows where it goes. - In Google Search Console, open Sitemaps under Indexing, enter the sitemap URL and press Submit.
- In Bing Webmaster Tools, use the Sitemaps section to submit the same URL.
Submitting does not guarantee every URL gets indexed. The Search Console report shows how many URLs were discovered and flags errors such as unreachable files or invalid dates.
Keeping it current
A sitemap is only useful while it is accurate. Plugins update automatically. If you build yours by hand, regenerate it when you add, remove or rename pages, and update lastmod only for real content changes.