XML Sitemap Guide: Create, Optimise, and Submit Your Sitemap

An XML sitemap tells Google which pages exist on your site and when they were last updated. Here's how to create one correctly, optimise it, and submit it to Google.

NK
Nitin KaushikPublished 15 June 2025 · 6 min read

Advertisement

An XML sitemap is a file that lists the important URLs on your website with optional metadata (last modified date, change frequency, priority). It acts as a roadmap for search engine crawlers — helping Googlebot discover pages it might otherwise miss and prioritise recently updated content.

What Is an XML Sitemap?

While Google can discover pages through links, XML sitemaps provide a reliable, complete inventory of your important content. They are especially valuable for: large sites with many pages, new sites with few inbound links, sites with pages not well-connected through internal links, and sites with frequently updated content (news, product catalogues, blog feeds).

XML Sitemap Format

A minimal XML sitemap requires the urlset wrapper with the correct XML namespace, plus a url element for each page containing a loc element with the full URL. Everything else (lastmod, changefreq, priority) is optional but recommended.

Use absolute URLs

All URLs in your sitemap must be absolute (https://yourdomain.com/page/), not relative (/page/). Include the protocol (https:// not http://) and ensure all URLs match your canonical URL format exactly.

Priority and Changefreq

Priority (0.0–1.0) signals the relative importance of pages on your site — not to other sites. Google's own guidance says it largely ignores these values as they became widely abused (everyone sets 1.0 for everything). Set 1.0 for homepage and top category pages; 0.8 for important content; 0.5–0.6 for less important pages. Changefreq (always, hourly, daily, weekly, monthly, yearly, never) is also largely disregarded by Google — lastmod is more useful.

Sitemap Index Files

Google limits individual sitemap files to 50,000 URLs and 50 MB. For larger sites, create multiple sitemaps and reference them in a sitemap index file. Separate sitemaps by content type (sitemap-posts.xml, sitemap-products.xml, sitemap-images.xml) for easier diagnostics in Search Console.

Submitting to Google

  1. Upload your sitemap to your domain root: https://yourdomain.com/sitemap.xml
  2. Sign in to Google Search Console at search.google.com/search-console
  3. Select your property (ensure it's verified)
  4. Go to Indexing → Sitemaps in the left navigation
  5. Enter your sitemap URL and click Submit
  6. Monitor the Discovered URLs count and check for errors over the following days

Generate your sitemap free

Create an XML sitemap with correct format, priority values, and lastmod dates.

Open Sitemap Generator →

Sitemap Best Practices

  • Only include canonical URLs — don't include paginated pages, search result pages, or duplicate URLs
  • Include lastmod dates that actually reflect content changes — Google uses this for crawl prioritisation
  • Reference your sitemap in robots.txt: Sitemap: https://yourdomain.com/sitemap.xml
  • Update your sitemap whenever you publish, unpublish, or significantly update content
  • Remove URLs that return 404 or 301 redirect — sitemaps should only contain 200 status pages
  • For image-heavy sites, use image sitemaps to help Google discover and index images

Frequently Asked Questions

Does a sitemap improve my rankings?

A sitemap doesn't directly improve rankings — it helps Google discover and index your pages more efficiently. For well-established sites with strong internal linking, a sitemap provides marginal benefit. For new or large sites, it significantly accelerates indexing of new content.

How often should I update my sitemap?

Ideally, your sitemap should update automatically whenever content changes. Static sites should regenerate sitemaps on every build. WordPress and CMS platforms with SEO plugins (Yoast, RankMath) update sitemaps automatically. At minimum, update manually when adding significant new sections.

Should I include all my pages in the sitemap?

No. Only include pages you want indexed: canonical pages, primary content pages, and important resources. Exclude: paginated pages (beyond page 1), search result pages, thank-you and confirmation pages, admin pages, thin or duplicate content pages, and any URL with noindex directive.

Related Tools