How to create a sitemap and submit it to Google

Six steps from nothing to a sitemap Google has read, with the checks that stop Search Console from filling up with errors.

1. Check whether you already have one

Most platforms make a sitemap automatically. Run your domain through the sitemap finder. If one turns up, validate it and skip to step 4.

2. Decide which URLs belong in it

Only pages you want to appear in search: status 200, indexable, and the canonical version. Leave out redirects, 404s, noindex pages, filtered or sorted duplicates, internal search results, cart and account pages, and URLs with tracking parameters. Use absolute URLs on the exact host and protocol you want indexed, for example always https://www..

3. Generate the file

Pick the source that already knows your URLs best:

  • Your CMS or framework (best): a plugin or built-in sitemap stays in sync and knows real modification dates.
  • A crawl: the generator follows links from your homepage (up to 300 pages), obeys robots.txt and drops noindex, redirected and non-canonical pages.
  • A URL export: paste or upload a list from your database, a crawler or analytics into the same generator. No size limit; it splits into 50,000-URL files with an index.

Only include <lastmod> if the dates are real. Here's why that matters.

4. Upload it to your site's root

Put the file at https://www.example.com/sitemap.xml. The location matters: per the protocol, a sitemap at /blog/sitemap.xml may only list URLs under /blog/. Open the URL in a private window to confirm it loads without a login and returns XML, not an HTML error page.

5. Announce it in robots.txt

User-agent: *
Disallow: /cart

Sitemap: https://www.example.com/sitemap.xml

This line tells every crawler, including ones you'll never submit to. Build the file with the robots.txt generator, and make sure no URL in your sitemap is disallowed (checker).

6. Submit it to Google and Bing

  1. Google Search Console: verify the site, then Indexing → Sitemaps → enter the URL → Submit. Submit the index if you have several files.
  2. Bing Webmaster Tools: Sitemaps → Submit sitemap. Bing's data also feeds DuckDuckGo and Yahoo results.

Google retired its sitemap "ping" URL in 2023, so tools that still ping it do nothing.

Afterwards: read the reports

In Search Console, open the submitted sitemap and choose "See page indexing". This shows how many sitemap URLs are indexed and why the rest aren't. Common reasons:

Report saysWhat to do
Page with redirectList the final URL, not the one that redirects.
Excluded by 'noindex' tagRemove the URL from the sitemap, or remove the noindex if the page should rank.
Blocked by robots.txtAllow crawling, or drop the URL from the sitemap.
Alternate page with proper canonical tagList only the canonical URL.
Discovered – currently not indexedGoogle knows the URL but hasn't crawled it yet. Often a sign of too many low-value URLs.
Crawled – currently not indexedGoogle read the page and chose not to index it. Improve or consolidate the content.

Questions people ask

How do I submit a sitemap to Google?
In Google Search Console, open your property, go to Indexing → Sitemaps, enter the sitemap URL (for example sitemap.xml) and press Submit. The status should change to "Success" once Google has read it.
Can I still ping Google with my sitemap URL?
No. Google retired the /ping?sitemap= endpoint in 2023 and now returns a 404 for it. Use Search Console, the robots.txt Sitemap: line, or the Search Console API. For Bing and others, IndexNow notifies them of individual changed URLs.
How long until Google reads my sitemap?
Usually within a few days of submission, and it re-reads known sitemaps on its own schedule afterwards. You don't need to resubmit after every change; keep the same URL and update the file.
Search Console says "Couldn't fetch". What now?
Open the sitemap URL in a private window. It must return HTTP 200 without a login, not be blocked by robots.txt or a firewall, and contain valid XML. Then run it through the validator. A fresh submission sometimes shows "Couldn't fetch" for a day before switching to "Success".
Should my CMS generate the sitemap instead?
If it can, yes: WordPress, Shopify, Wix, Squarespace and most frameworks can keep a sitemap in sync automatically, with accurate lastmod dates. Use a generator for static sites, one-off audits, migrations, or when the built-in sitemap is wrong.