seolivly
Sitemap guide

How to Create an XML Sitemap and Submit It

A sitemap is a list of the pages you want found. Making one takes minutes, and submitting it tells search engines exactly where to look.

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>
  • loc is the full URL, and is required.
  • lastmod is 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.
  • changefreq and priority are 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

  1. Upload sitemap.xml to your site, usually at the root: https://example.com/sitemap.xml. Open it in a browser to check.
  2. Add a line to your robots.txt: Sitemap: https://example.com/sitemap.xml. Our guide on writing robots.txt shows where it goes.
  3. In Google Search Console, open Sitemaps under Indexing, enter the sitemap URL and press Submit.
  4. 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.

Frequently asked questions

Where should my sitemap be located?

Usually at the root, such as https://example.com/sitemap.xml. List it in robots.txt and submit it in Search Console.

How do I submit a sitemap to Google?

In Google Search Console, open Sitemaps under Indexing, enter the sitemap URL and press Submit.

How many URLs can a sitemap contain?

Up to 50,000 URLs and 50 MB uncompressed. Use a sitemap index to combine several files.

Does a sitemap improve rankings?

Not directly. It helps search engines find and understand your pages, which they need before they can rank them.

Should every page be in my sitemap?

Only canonical, indexable pages you want in search results.

Keep going