Sitemap Generator

How to Create an XML Sitemap

📅 April 2026⏱ 7 min read✍️ ToolsBox

An XML sitemap is a file that lists every important URL on your website in a structured format that search engines can read efficiently. It helps Google and Bing discover your pages faster, understand your site's structure, and prioritise their crawling. Creating and maintaining a sitemap is one of the most impactful technical SEO tasks, especially for new or large websites.

What Is an XML Sitemap?

An XML sitemap is a file at a predictable URL (typically https://yourdomain.com/sitemap.xml) that lists your site's URLs in XML format. Each URL entry can include optional metadata:

  • <loc> — The full URL of the page (required)
  • <lastmod> — When the page was last significantly changed (helps Google decide when to re-crawl)
  • <changefreq> — How often the page changes (daily, weekly, monthly, etc.). Note: Google largely ignores this tag in practice.
  • <priority> — The relative importance of this URL (0.0 to 1.0). Note: Google largely ignores this too — every page on every site typically claims 1.0 priority, making it meaningless.

The only truly useful tags are <loc> and <lastmod>. changefreq and priority are optional and largely ignored by Google.

The Sitemap XML Format

A valid sitemap follows the Sitemaps.org protocol:

<?xml version="1.0" encoding="UTF-8"?>
<urlset xmlns="http://www.sitemaps.org/schemas/sitemap/0.9">

  <url>
    <loc>https://yourdomain.com/</loc>
    <priority>1.0</priority>
    <changefreq>weekly</changefreq>
    <lastmod>2026-04-17</lastmod>
  </url>

  <url>
    <loc>https://yourdomain.com/about/</loc>
    <priority>0.8</priority>
    <lastmod>2026-01-15</lastmod>
  </url>

</urlset>

Key rules:

  • All URLs must be absolute (include https://)
  • URLs must match the canonical version of each page
  • Maximum 50,000 URLs per sitemap file and maximum 50 MB uncompressed
  • For larger sites, use a sitemap index file that references multiple sitemap files

What to Include in Your Sitemap

Include: All important, indexable pages — your homepage, key category pages, blog posts, product pages, tool pages, and any page you want Google to find and rank.

Exclude:

  • Pages with noindex tags (including them wastes crawl budget)
  • Duplicate pages (only include the canonical version)
  • Admin, login, cart, and checkout pages
  • Paginated results pages (usually only the first page deserves to be in the sitemap)
  • Utility pages (404, 500, maintenance pages)
  • Pages you have disallowed in robots.txt (Google cannot crawl the sitemap entry to index the page)

How to Create a Sitemap

Using a CMS plugin: Most popular CMSs have plugins that auto-generate sitemaps. WordPress: Yoast SEO or Rank Math. Squarespace: built-in. Shopify: auto-generated at /sitemap.xml.

Using our free generator: Our Sitemap Generator lets you paste a list of URLs and generates a valid sitemap.xml file. Ideal for small static sites.

Manually: For small sites (under 20 pages), you can write the XML by hand using the format above. Save as sitemap.xml and upload to your server root.

How to Submit Your Sitemap to Google

  1. Go to Google Search Console.
  2. Select your property (add and verify your site if you have not already).
  3. In the left sidebar, click Sitemaps.
  4. In the "Add a new sitemap" field, enter the path to your sitemap: sitemap.xml
  5. Click Submit.

Google will show the submission status, how many URLs were discovered, and any errors. Also add the sitemap URL to your robots.txt file: Sitemap: https://yourdomain.com/sitemap.xml

Submit to Bing as well via Bing Webmaster Tools (webmaster.bing.com) — the process is the same.

Generate your XML sitemap — free

Paste your URLs and get a valid sitemap.xml file ready to upload and submit.
Open Sitemap Generator →

Frequently Asked Questions

Does every website need an XML sitemap?

Not strictly required — Google can discover and crawl pages through links. But sitemaps help, especially for: new sites with few backlinks; sites with lots of pages (100+); sites with deep navigation that crawlers might not fully traverse; and sites where pages are not well-linked to each other.

How often should I update my sitemap?

Update your sitemap whenever you add, remove, or significantly update important pages. Set the lastmod date to when the page was last meaningfully changed. If you use a CMS, use a plugin (e.g. Yoast for WordPress) to automatically regenerate the sitemap when content changes.

How do I submit a sitemap to Google?

Go to Google Search Console (search.google.com/search-console) → select your property → Sitemaps (in the left menu) → enter your sitemap URL (e.g., /sitemap.xml) → Submit. Google will begin processing it. You can also submit via robots.txt by adding 'Sitemap: https://yourdomain.com/sitemap.xml'.

What is the difference between an XML sitemap and an HTML sitemap?

An XML sitemap is a machine-readable file for search engines — it lists URLs with metadata like last modified date and priority. An HTML sitemap is a human-readable page listing your site's pages in a navigable structure. Both serve different purposes and many sites have both.

Back to Blog  |  Related tool: Sitemap Generator