Sitemap Templates: Copy-Paste XML for Common Use Cases
Ready-to-use XML sitemap templates for standard sites, blogs, e-commerce stores, multilingual sites, and more. Copy, customize, and submit.
Starting an XML sitemap from scratch is straightforward once you have a template. This page provides copy-paste-ready sitemap templates for the most common use cases. Pick the template that matches your situation, replace the example URLs with your own, and submit it to Google Search Console. For a full explanation of how sitemaps work, see our XML sitemap guide.
Basic XML Sitemap
The simplest valid sitemap. Lists URLs with no optional metadata.
<?xml version="1.0" encoding="UTF-8"?>
<urlset xmlns="http://www.sitemaps.org/schemas/sitemap/0.9">
<url>
<loc>https://example.com/</loc>
</url>
<url>
<loc>https://example.com/about/</loc>
</url>
<url>
<loc>https://example.com/contact/</loc>
</url>
<url>
<loc>https://example.com/services/</loc>
</url>
</urlset>
Use this when: You have a small site and want the minimum viable sitemap. This is valid and functional. Google will crawl every URL listed.
Sitemap with Last Modified Dates
Adding <lastmod> helps search engines identify which pages have been updated recently.
<?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-06-09</lastmod>
</url>
<url>
<loc>https://example.com/about/</loc>
<lastmod>2026-03-15</lastmod>
</url>
<url>
<loc>https://example.com/blog/latest-post/</loc>
<lastmod>2026-06-08</lastmod>
</url>
<url>
<loc>https://example.com/products/widget/</loc>
<lastmod>2026-05-22</lastmod>
</url>
</urlset>
Use this when: You want to give search engines a signal about content freshness. Use the W3C date format: YYYY-MM-DD or the full datetime YYYY-MM-DDThh:mm:ssTZD. Only set lastmod to the date the content actually changed, not the current date on every build.
Blog Sitemap
A sitemap template for a blog with posts organized by date.
<?xml version="1.0" encoding="UTF-8"?>
<urlset xmlns="http://www.sitemaps.org/schemas/sitemap/0.9">
<url>
<loc>https://example.com/blog/</loc>
<lastmod>2026-06-09</lastmod>
</url>
<url>
<loc>https://example.com/blog/how-to-get-started/</loc>
<lastmod>2026-06-09</lastmod>
</url>
<url>
<loc>https://example.com/blog/advanced-techniques/</loc>
<lastmod>2026-06-01</lastmod>
</url>
<url>
<loc>https://example.com/blog/common-mistakes/</loc>
<lastmod>2026-05-15</lastmod>
</url>
<url>
<loc>https://example.com/blog/case-study-acme/</loc>
<lastmod>2026-04-28</lastmod>
</url>
<url>
<loc>https://example.com/blog/year-in-review/</loc>
<lastmod>2026-01-05</lastmod>
</url>
</urlset>
Use this when: You run a blog and want all posts in one sitemap. Include only the individual post URLs and the blog index page. Do not include paginated archive pages (/blog/page/2/) unless they have unique content worth indexing.
E-Commerce Sitemap
A template for an online store with product pages, category pages, and informational pages.
<?xml version="1.0" encoding="UTF-8"?>
<urlset xmlns="http://www.sitemaps.org/schemas/sitemap/0.9">
<!-- Main pages -->
<url>
<loc>https://example.com/</loc>
<lastmod>2026-06-09</lastmod>
</url>
<url>
<loc>https://example.com/about/</loc>
<lastmod>2026-01-10</lastmod>
</url>
<!-- Category pages -->
<url>
<loc>https://example.com/category/electronics/</loc>
<lastmod>2026-06-08</lastmod>
</url>
<url>
<loc>https://example.com/category/clothing/</loc>
<lastmod>2026-06-07</lastmod>
</url>
<!-- Product pages -->
<url>
<loc>https://example.com/products/wireless-headphones/</loc>
<lastmod>2026-06-05</lastmod>
</url>
<url>
<loc>https://example.com/products/cotton-t-shirt/</loc>
<lastmod>2026-06-03</lastmod>
</url>
<url>
<loc>https://example.com/products/running-shoes/</loc>
<lastmod>2026-05-29</lastmod>
</url>
</urlset>
Use this when: You run an e-commerce site. For stores with thousands of products, split the sitemap into separate files by category and use a sitemap index. Do not include URLs for filtered views, sort variations, or session-based URLs. For strategy details, see e-commerce sitemap strategy.
Sitemap with Images
An XML sitemap that includes image information for Google Image search.
<?xml version="1.0" encoding="UTF-8"?>
<urlset xmlns="http://www.sitemaps.org/schemas/sitemap/0.9"
xmlns:image="http://www.google.com/schemas/sitemap-image/1.1">
<url>
<loc>https://example.com/products/wireless-headphones/</loc>
<image:image>
<image:loc>https://example.com/images/headphones-front.jpg</image:loc>
</image:image>
<image:image>
<image:loc>https://example.com/images/headphones-side.jpg</image:loc>
</image:image>
</url>
<url>
<loc>https://example.com/products/cotton-t-shirt/</loc>
<image:image>
<image:loc>https://example.com/images/tshirt-white.jpg</image:loc>
</image:image>
<image:image>
<image:loc>https://example.com/images/tshirt-black.jpg</image:loc>
</image:image>
</url>
</urlset>
Use this when: You want to improve visibility in Google Image search, especially for product images or other visual content. Each URL can have up to 1,000 image entries.
Sitemap Index
A sitemap index file that references multiple sitemaps. Use this to organize large sites.
<?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>
<lastmod>2026-06-09</lastmod>
</sitemap>
<sitemap>
<loc>https://example.com/sitemap-blog.xml</loc>
<lastmod>2026-06-09</lastmod>
</sitemap>
<sitemap>
<loc>https://example.com/sitemap-products.xml</loc>
<lastmod>2026-06-08</lastmod>
</sitemap>
<sitemap>
<loc>https://example.com/sitemap-images.xml</loc>
<lastmod>2026-06-07</lastmod>
</sitemap>
</sitemapindex>
Use this when: Your site has more than 50,000 URLs, or you want to organize sitemaps by content type for easier management. Submit only the sitemap index URL to Search Console -- Google will discover the individual sitemaps from it.
Multilingual Sitemap with Hreflang
A sitemap that includes hreflang annotations for multilingual sites.
<?xml version="1.0" encoding="UTF-8"?>
<urlset xmlns="http://www.sitemaps.org/schemas/sitemap/0.9"
xmlns:xhtml="http://www.w3.org/1999/xhtml">
<url>
<loc>https://example.com/en/page/</loc>
<xhtml:link rel="alternate" hreflang="en" href="https://example.com/en/page/" />
<xhtml:link rel="alternate" hreflang="fr" href="https://example.com/fr/page/" />
<xhtml:link rel="alternate" hreflang="de" href="https://example.com/de/page/" />
<xhtml:link rel="alternate" hreflang="x-default" href="https://example.com/en/page/" />
<lastmod>2026-06-09</lastmod>
</url>
<url>
<loc>https://example.com/fr/page/</loc>
<xhtml:link rel="alternate" hreflang="en" href="https://example.com/en/page/" />
<xhtml:link rel="alternate" hreflang="fr" href="https://example.com/fr/page/" />
<xhtml:link rel="alternate" hreflang="de" href="https://example.com/de/page/" />
<xhtml:link rel="alternate" hreflang="x-default" href="https://example.com/en/page/" />
<lastmod>2026-06-09</lastmod>
</url>
<url>
<loc>https://example.com/de/page/</loc>
<xhtml:link rel="alternate" hreflang="en" href="https://example.com/en/page/" />
<xhtml:link rel="alternate" hreflang="fr" href="https://example.com/fr/page/" />
<xhtml:link rel="alternate" hreflang="de" href="https://example.com/de/page/" />
<xhtml:link rel="alternate" hreflang="x-default" href="https://example.com/en/page/" />
<lastmod>2026-06-09</lastmod>
</url>
</urlset>
Use this when: You have a multilingual site and want to declare hreflang relationships in your sitemap rather than in HTML head tags. Each URL entry must include the full set of hreflang links, including a self-referencing one. See our hreflang sitemaps guide for details.
News Sitemap
A template for news publishers.
<?xml version="1.0" encoding="UTF-8"?>
<urlset xmlns="http://www.sitemaps.org/schemas/sitemap/0.9"
xmlns:news="http://www.google.com/schemas/sitemap-news/0.9">
<url>
<loc>https://example.com/2026/06/breaking-news-story/</loc>
<news:news>
<news:publication>
<news:name>Example News</news:name>
<news:language>en</news:language>
</news:publication>
<news:publication_date>2026-06-09T10:00:00+00:00</news:publication_date>
<news:title>Breaking News Story Headline</news:title>
</news:news>
</url>
<url>
<loc>https://example.com/2026/06/second-story/</loc>
<news:news>
<news:publication>
<news:name>Example News</news:name>
<news:language>en</news:language>
</news:publication>
<news:publication_date>2026-06-09T08:30:00+00:00</news:publication_date>
<news:title>Second Story Headline</news:title>
</news:news>
</url>
</urlset>
Use this when: You publish news content and want it in Google News. Only include articles from the last 48 hours. Maximum 1,000 URLs. The publication name must match your Google Publisher Center registration. See our news sitemap guide for full requirements.
Validate before submitting
After creating your sitemap from a template, validate it before submitting to Google. Check that all URLs return 200 status codes, the XML is well-formed, and the file is under 50 MB. See our sitemap validation guide for tools and checks.
Template Customization Tips
Replace all example URLs. Every https://example.com/ URL must be replaced with your actual domain and page paths. The URLs must be absolute (include the full domain), not relative.
Use consistent trailing slashes. If your site uses trailing slashes (/page/), use them in the sitemap. If it does not (/page), do not add them. The URLs in the sitemap must match the canonical URLs of your pages exactly.
Use HTTPS. If your site is served over HTTPS, all sitemap URLs must use https://. Do not mix HTTP and HTTPS URLs.
Set accurate lastmod dates. Only use lastmod if you can set it to the actual date the page content was last changed. Setting it to today's date on every build degrades its usefulness as a signal.
Keep it under limits. 50,000 URLs and 50 MB per file. Use gzip compression (.xml.gz) if your sitemap is large but under the URL limit.
Where to Put Your Sitemap
The standard location is at the root of your domain: https://example.com/sitemap.xml. Reference it in your robots.txt file:
Sitemap: https://example.com/sitemap.xml
You can also submit it directly through Google Search Console and Bing Webmaster Tools. See how to submit a sitemap to Google and how to submit a sitemap to Bing.
Summary
Pick the template that matches your site, replace the example URLs with your own, validate the XML, and submit. Start with the basic template if you are unsure, and add image, video, or news extensions as your content grows. For most sites, a standard XML sitemap with lastmod dates is all you need.
Generate a sitemap automatically
Skip the templates. Crawl your site and get a ready-to-submit XML sitemap in seconds.
Try Instant Sitemap