How to create and submit an XML sitemap
On this page
Why this matters for SEO
Generate a sitemap of canonical, indexable URLs, publish it at your domain root, reference it in robots.txt and submit it in Google Search Console.
Search visibility depends on several systems agreeing: the page must be reachable, discoverable, technically eligible to be indexed, useful for the query, and supported by a clear internal site structure. Fixing one symptom while another system is blocking the page can produce little or no improvement.
Use this guide as a focused workflow rather than a checklist to complete blindly. Confirm the actual page and response first, make the smallest defensible change, then re-test the same evidence after deployment.
Is this your problem?
- Google does not discover your newer pages.
- Search Console reports that the sitemap could not be read.
Common causes
- No sitemap exists, or it lists redirected, noindexed or error URLs.
- The sitemap is not published at a reachable URL.
Check access and HTTP status first, then robots and indexability directives, canonicalization, content/template quality, internal links and performance. This order prevents a low-priority content edit from hiding a technical blocker.
Step-by-step fix
Generate the file
Enter your public URL in the XML Sitemap Generator, set a page limit and exclude patterns for private or duplicate sections, then download sitemap.xml.
Review the URLs
Open the XML and remove URLs that redirect, return errors, are noindexed or point to a different canonical.
Publish it
Upload sitemap.xml to your site root so it loads at https://yourdomain/sitemap.xml.
Reference it
Add a line Sitemap: https://yourdomain/sitemap.xml to robots.txt.
Validate
Run the XML Sitemap Validator to catch malformed XML and duplicates.
Submit
In Search Console open Sitemaps, enter the sitemap URL and submit it.
How to confirm it worked
Verification should use the same URL and comparable conditions as the original test. Check the HTTP response, rendered/source markup and the relevant Google Search Console report where applicable. A successful technical change does not guarantee immediate indexing; crawling and indexing can take time and Google may still choose not to index a page it considers redundant or low quality.
Mistakes to avoid
- Listing URLs that redirect or are noindexed.
- Exceeding 50,000 URLs or 50 MB uncompressed in one file instead of using a sitemap index.
Tools to use
FAQ
Does a sitemap make Google index my pages?
No. It helps discovery. Indexing depends on quality and technical signals.
How often should I regenerate it?
Whenever pages are added or removed. Many CMSs can regenerate it automatically.
Check your own site now. The free SeOMeter tools run these checks on your own URLs, no sign-up needed.
Open the SEO toolsWas something unclear or out of date? Tell us and we will improve this guide. SEO checks are diagnostic guidance, not a promise of rankings, traffic or indexing.