How to create a sitemap and submit it to Google

· 4 min read

A sitemap is a list of the pages on your website that you want search engines to find. Google can discover pages by following links, but a sitemap makes sure nothing is missed, especially on a new site that has few links pointing to it yet.

This guide covers what a sitemap looks like, how to create one and how to submit it.

What a sitemap looks like

A sitemap is an XML file, usually at https://yourdomain.com/sitemap.xml. A small one looks like this:

<?xml version="1.0" encoding="UTF-8"?>
<urlset xmlns="http://www.sitemaps.org/schemas/sitemap/0.9">
  <url>
    <loc>https://yourdomain.com/</loc>
    <lastmod>2026-11-20</lastmod>
  </url>
  <url>
    <loc>https://yourdomain.com/about/</loc>
  </url>
  <url>
    <loc>https://yourdomain.com/contact/</loc>
  </url>
</urlset>

Each page gets a <url> block with:

  • <loc>: the full address of the page, including https://. Required.
  • <lastmod>: the date the page last changed in a meaningful way. Optional, but Google uses it when it is accurate.

You may also see <changefreq> and <priority> in older sitemaps. Google ignores both, so you can leave them out.

What to include, and what to leave out

Include the pages you want people to find in search:

  • Home page, main pages, articles, product or tool pages.

Leave out:

  • Pages with a noindex tag.
  • Duplicate versions of a page, such as the same page with tracking parameters.
  • Redirects and pages that return errors.
  • Private pages such as login, cart, checkout and admin.

Use one consistent version of each address. If your site uses https://www. and trailing slashes, every <loc> should use exactly that form. Mixing versions sends confusing signals.

Size limits

One sitemap file can hold up to 50,000 addresses and must be no larger than 50 MB uncompressed. Bigger sites split their pages into several sitemaps and list them in a sitemap index file. Many website platforms do this automatically, which is why you sometimes see addresses like /sitemap-index.xml or /sitemap_index.xml.

How to create one

If your platform makes it for you, use that. WordPress (with most SEO plugins), Shopify, Wix, Squarespace and many site frameworks generate and update a sitemap automatically. Open yourdomain.com/sitemap.xml to see whether yours exists.

If your site is hand-made or built with an AI tool, you can:

  1. Ask the tool or framework to generate a sitemap at build time. This is the best option because it stays up to date.
  2. Create one yourself with our free Sitemap Generator. Paste your page addresses, pick dates, and download a valid sitemap.xml.

Upload the file to the root of your website so it opens at https://yourdomain.com/sitemap.xml.

Tell search engines where it is

1. Add it to robots.txt

Add one line to your robots.txt file, using the full address:

Sitemap: https://yourdomain.com/sitemap.xml

Every search engine that reads robots.txt will find it. Our guide robots.txt explained shows a complete example.

2. Submit it in Google Search Console

  1. Go to Google Search Console and add your website if you have not already. The Domain property type covers every version of your site (http, https, www and non-www) and is verified with a DNS record.
  2. Open Sitemaps in the left menu.
  3. Enter the address of your sitemap and press Submit.

The status may show “Couldn’t fetch” or “Pending” for a little while on a new site. That is normal. After Google processes it, you will see how many addresses it found.

Note that Google retired its old “sitemap ping” address in 2023, so pinging a URL no longer works. Use Search Console and robots.txt instead.

3. Submit it to Bing

Bing Webmaster Tools can import your site straight from Google Search Console, which saves you the verification step. Then open Sitemaps and submit the same address. Bing’s index is also used by several other search tools.

After submitting

A sitemap is a hint, not a command. Google decides what to crawl and index based on quality and many other signals. On a new site it is normal for indexing to take from a few days to a few weeks. If pages stay unindexed for longer, read why Google is not indexing your new website.

Keep the sitemap current. When you add or remove pages, the sitemap should change too. A generated sitemap does this for you; a hand-made one needs updating each time.

Quick check

  • https://yourdomain.com/sitemap.xml opens and shows XML, not an error page.
  • Every address in it uses https:// and your main domain version.
  • No address in it redirects, returns an error or has noindex.
  • robots.txt has a Sitemap: line with the full address.
  • The sitemap is submitted in Google Search Console and Bing Webmaster Tools.

A free Sitecarely checkup checks that your robots.txt and sitemap exist and can be read, and counts the addresses in your sitemap.

More guides