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.xmlThis 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
- Google Search Console: verify the site, then Indexing → Sitemaps → enter the URL → Submit. Submit the index if you have several files.
- 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 says | What to do |
|---|---|
| Page with redirect | List the final URL, not the one that redirects. |
| Excluded by 'noindex' tag | Remove the URL from the sitemap, or remove the noindex if the page should rank. |
| Blocked by robots.txt | Allow crawling, or drop the URL from the sitemap. |
| Alternate page with proper canonical tag | List only the canonical URL. |
| Discovered – currently not indexed | Google knows the URL but hasn't crawled it yet. Often a sign of too many low-value URLs. |
| Crawled – currently not indexed | Google 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?
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?
/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.