By SitemapFixer Team
Updated October 2026

How to Create a Sitemap for Your Website

No sitemap yet? Generate one from your live siteGenerate My Sitemap

Short answer: first check whether your site already has one. Most platforms (WordPress, Shopify, Wix, Squarespace) create an XML sitemap for you. If yours does not, use a sitemap generator that crawls your site, write the file by hand if you have only a few dozen pages, or generate it from your code. Whatever the method, list only pages you want in Google, then submit the sitemap in Google Search Console and Bing Webmaster Tools.

Google’s own advice: for more than a few dozen URLs, “the best way is to have your website software generate it for you,” because a hand-made sitemap is hard to keep up to date.

Way 1: use the sitemap your platform already makes

Try these addresses on your domain. If one opens a page of XML, you already have a sitemap.

PlatformSitemap URLNotes
WordPress (core, 5.5+)/wp-sitemap.xmlBuilt in. An SEO plugin replaces it with its own.
WordPress + Yoast or Rank Math/sitemap_index.xmlTurned on in the plugin settings.
Shopify/sitemap.xmlAutomatic, cannot be edited directly.
Wix/sitemap.xmlAutomatic.
Squarespace/sitemap.xmlAutomatic.
Next.js (App Router, 13.3+)/sitemap.xmlYou write app/sitemap.ts; Next.js serves the XML.

Not sure where yours is? The free sitemap finder checks robots.txt and the common locations for you. Platform guides: WordPress, Shopify, Wix, Squarespace, Next.js. WooCommerce stores use the WordPress sitemap.

Way 2: use a sitemap generator

For static sites, custom builds, or a platform without a sitemap, a generator crawls your site the way a search engine does and writes the file. Our free XML sitemap generator works like this:

  • It starts at your home page and follows links, up to 500 pages, and obeys your robots.txt.
  • It keeps a page only if it returns 200, is not noindexed, and its canonical tag points to itself. Everything else is listed as “left out” with the reason.
  • It adds <lastmod> only from a real Last-Modified header, never the crawl time.
  • It does not run JavaScript, so links that only appear after scripts run are not found.

A generated sitemap is a snapshot. If you add pages often, you will need to run it again, or switch to a sitemap your site builds automatically.

Way 3: write it by hand

For a small site, a text editor is enough. Save this as sitemap.xml with UTF-8 encoding and add one <url> block per page:

<?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-10-01</lastmod>
  </url>
  <url>
    <loc>https://example.com/services</loc>
  </url>
</urlset>

Rules that trip people up:

  • Use full URLs with https://, all on the same host as the sitemap.
  • Escape special characters: write &amp; for & in a URL.
  • Only <loc> is required. Google ignores <priority> and <changefreq>, and uses <lastmod> only when it is consistently accurate.

The full tag reference is in our XML sitemap format guide.

Way 4: generate it from your code

If your site is built with a framework, create the sitemap in code so it updates on every deploy. In Next.js (App Router), an app/sitemap.ts file returns the list of URLs and Next.js serves it as XML at /sitemap.xml. Other frameworks (Astro, Nuxt, Django, Rails and more) have an official plugin or a built-in helper. Read URLs from the same data that builds your pages, so the sitemap never lists a page that doesn’t exist.

What to include (and what to leave out)

Google says to include the URLs “you want to see in Google’s search results.” In practice, that means each URL should:

  • return status 200 (no redirects, no 404s),
  • not be noindexed or blocked by robots.txt,
  • be the canonical version (not a ?sort= or tracking URL).

One sitemap holds at most 50,000 URLs and 50 MB uncompressed. Bigger sites split their URLs into several files and list them in a sitemap index.

Test it, then submit it

  1. Test it. The free sitemap checker reads your sitemap and tests 30 of its URLs live for errors, redirects, noindex and canonical problems.
  2. Put it at your site root (for example https://example.com/sitemap.xml) and add Sitemap: https://example.com/sitemap.xml to robots.txt.
  3. Submit it to Google in Search Console under Sitemaps. See how to submit a sitemap to Google.
  4. Submit it to Bing in Bing Webmaster Tools. See how to submit a sitemap to Bing.

Google calls a submitted sitemap “merely a hint”. It helps Google find your pages, but it doesn’t guarantee they get indexed.

Frequently asked questions

Do I need to create a sitemap if my CMS already has one?

No. WordPress, Shopify, Wix, Squarespace and most other platforms make one for you. Find its URL, check it lists the right pages, and submit it.

Can I create a sitemap for free?

Yes. CMS sitemaps are free, and so are many generators. Our XML sitemap generator crawls up to 500 pages for free and keeps only pages that can be indexed.

How many URLs can one sitemap have?

Up to 50,000 URLs and 50 MB uncompressed. For more, split the URLs into several sitemaps and list them in a sitemap index file.

Which pages should go in my sitemap?

Only pages you want in search results: pages that return 200, are not noindexed or blocked by robots.txt, and point their canonical tag to themselves. Leave out redirects, errors and duplicate URLs.

Is a visual sitemap the same thing?

No. A visual sitemap is a diagram used to plan a website’s structure (tools like Figma or Miro make them). An XML sitemap is a file for search engines. This guide covers the XML kind.

Create a clean XML sitemap from your live site
Free - crawls up to 500 pages and keeps only indexable ones
Generate My Sitemap Free

Related guides