How to Create and Submit an XML Sitemap
A sitemap is your site’s list of URLs for crawlers. Used well it speeds up discovery and surfaces important pages; used badly it wastes crawl budget.
What an XML sitemap does
An XML sitemap lists the URLs you want search engines to know about, optionally with a last-modified date, change frequency and priority. It is a hint, not a guarantee: crawlers still decide what to fetch and index.
What to include — and exclude
Include: canonical, indexable pages that return HTTP 200.
Exclude:
- Redirects (3xx) and errors (4xx/5xx)
noindexpages- Duplicate or parameterised URLs
- Pages blocked in robots.txt
A sitemap full of non-canonical URLs wastes crawl budget and dilutes signals.
Structure and size limits
- A single sitemap may contain up to 50,000 URLs and be 50 MB uncompressed.
- Beyond that, use a sitemap index that references multiple sitemaps.
- Only absolute URLs are valid.
<?xml version="1.0" encoding="UTF-8"?>
<urlset xmlns="http://www.sitemaps.org/schemas/sitemap/0.9">
<url>
<loc>https://example.com/page</loc>
<lastmod>2026-09-16</lastmod>
</url>
</urlset>
Generate one with the free XML sitemap generator.
Submit it the right way
- Add a
Sitemap:line to robots.txt. - In Google Search Console → Sitemaps, submit your sitemap URL.
- In Bing Webmaster Tools, do the same.
- Keep
lastmodaccurate — stale dates reduce trust.
Best practices
- One canonical URL per page. No duplicates.
- Update
lastmodonly when content really changes. - Split by content type (pages, products, blog) for clearer reporting.
- Verify status codes. A sitemap pointing at 404s is worse than none — audit with the HTTP status checker.
- Reference it in robots.txt so every crawler finds it.
Common mistakes
- Listing redirected or noindex URLs.
- Forgetting the sitemap after a site migration.
- Using relative URLs.
- Including thousands of low-value pages.
- Never updating
lastmod.
Generate and submit
Create a clean sitemap with the XML sitemap generator, then submit it in Search Console — it takes two minutes.