top of page

XML Sitemap: How to Create and Submit It to Google

Jan 21
5 min read

An XML sitemap is a file that lists the URLs on your website and provides metadata about each URL — when it was last updated, how often it changes, and its relative importance. It is a roadmap that helps search engine crawlers discover your pages more efficiently, particularly important for large sites, new sites, and pages with few incoming internal links.

An XML sitemap is not a ranking factor — it doesn't improve rankings directly. What it does is help Google discover and index your pages more quickly and reliably, ensuring your content has the opportunity to rank.

⠀

Why XML Sitemaps Matter

⠀

New websites: Before any external links exist pointing to a new site, search engines may struggle to discover pages through normal crawling. Submitting an XML sitemap accelerates initial indexation.

Large websites: Sites with hundreds or thousands of pages may have pages that are deeply buried in the navigation hierarchy. A sitemap ensures these pages are discoverable without requiring Google to follow every link path.

Orphan pages: Pages with no internal links pointing to them (or very few) receive less crawl attention. Sitemaps ensure these pages are at least discoverable by crawlers, even if they lack internal link equity.

Content freshness signaling: The <lastmod> tag in a sitemap indicates when a page was last updated. This helps Google prioritize recrawling updated pages.

⠀

What to Include in Your XML Sitemap

⠀

An XML sitemap should include all pages you want Google to index. Conversely, exclude pages you don't want indexed:

Include:

  • Service/product pages

  • Blog posts and articles

  • Category pages (for e-commerce)

  • About, Contact, and other core pages

  • Landing pages

⠀

Exclude:

  • Thank-you pages and confirmation pages

  • Login and account pages

  • Pages with noindex directives (it's contradictory to include them in the sitemap if you've told Google not to index them)

  • Duplicate URLs (if a page has a canonical pointing to a different URL, include only the canonical URL)

  • Staging or development URLs

⠀

Pagination: For paginated content (page 2, page 3 of blog archives), include paginated pages in the sitemap if they have unique content worth indexing. If they're thin or duplicative, exclude them.

⠀

How to Generate Your XML Sitemap

⠀

⠀

⠀

WordPress: SEO plugins (Yoast SEO, RankMath, All in One SEO) automatically generate and maintain an XML sitemap. Typically accessible at yourdomain.com/sitemap_index.xml or yourdomain.com/sitemap.xml.

Wix: Wix automatically generates a sitemap at yourdomain.com/sitemap.xml. The sitemap is updated automatically when pages are added or removed.

Shopify: Automatically generates a sitemap at yourdomain.com/sitemap.xml covering products, collections, pages, and blog posts.

Custom or static sites: Use online XML sitemap generators (xml-sitemaps.com, Screaming Frog can generate sitemaps) or create one manually following the sitemap protocol.

Sitemap index files: Large sites split their sitemap into multiple files (one per content type: posts, products, pages) linked from a sitemap index file. Google supports sitemap files up to 50MB and 50,000 URLs per file.

⠀

Submitting Your Sitemap to Google

⠀

Step 1: Verify your sitemap URL by accessing it in your browser. It should display an XML file with your URLs.

Step 2: Log into Google Search Console, navigate to the property for your site.

Step 3: Go to Indexing → Sitemaps in the left menu.

Step 4: Enter your sitemap URL (e.g., sitemap.xml or sitemap_index.xml) in the "Enter sitemap URL" field and click Submit.

Google will then fetch and process the sitemap. The Sitemaps report shows the submitted URL count and how many URLs have been indexed.

⠀

Interpreting Sitemap Data in Search Console

⠀

⠀

⠀

The XML sitemap data in Search Console provides actionable insights:

Submitted vs. indexed gap: If you submitted 500 URLs but only 200 are indexed, Google is choosing not to index 300 of your pages. This indicates content quality or duplication issues on the non-indexed pages — they require content improvement, not just technical fixes.

Sitemap errors: Failed fetches of the sitemap file itself indicate server configuration issues. Ensure the sitemap URL is accessible without authentication and returns the correct Content-Type header.

Last read date: Google shows when it last fetched your sitemap. If the last read date is weeks ago, consider whether your site's crawl frequency warrants more frequent sitemap updates or whether Google needs a crawl prompt via URL inspection.

⠀

XML Sitemap Best Practices

⠀

Reference the sitemap in robots.txt: Add Sitemap: https://yourdomain.com/sitemap.xml to your robots.txt file. This allows any crawler to discover your sitemap automatically, not just Google.

Keep the sitemap current: Sitemaps should automatically update when content is added, modified, or removed. Stale sitemaps that reference deleted pages or outdated URLs create processing overhead without benefit.

Use `<lastmod>` correctly: Only update the <lastmod> value when the page content genuinely changes. Inflating lastmod values to signal false freshness is counterproductive — Google ignores lastmod when it doesn't reflect actual page changes.

Separate sitemap types for large sites: Having separate sitemaps for blog posts, service pages, and products makes it easier to diagnose which content type has indexation issues.

Blakfy creates and optimizes XML sitemaps for clients — ensuring all valuable pages are included, all pages that shouldn't be indexed are excluded, and the sitemap data is used to monitor and improve indexation coverage.

⠀

⠀

Frequently Asked Questions

⠀

Does having an XML sitemap improve rankings?

An XML sitemap doesn't directly improve rankings — it helps Google find and index your pages, which is a prerequisite for ranking. If your pages are already being fully indexed, a sitemap has minimal additional impact. Where sitemaps produce noticeable improvement is for new sites, sites with frequently added content, or sites with pages that lack strong internal linking and are otherwise hard to discover.

Do I need a sitemap if my site has good internal linking?

Good internal linking is the primary way Google discovers pages and is more important than a sitemap for crawl efficiency. If every important page is reachable within 3 clicks from the homepage and is linked from multiple other pages, a sitemap is beneficial but not critical. Sitemaps become more important as sites grow larger and internal linking becomes harder to maintain perfectly.

How often should I update my XML sitemap?

Your sitemap should update automatically when content changes — most CMS platforms handle this automatically. Manually generated sitemaps should be regenerated whenever significant content is added or removed. There's no need to submit the sitemap to Search Console again after updates; Google will re-fetch the sitemap URL it already knows about.

What is a sitemap index file?

A sitemap index file is a parent sitemap that references multiple child sitemaps rather than listing URLs directly. Large websites use sitemap index files to organize sitemaps by content type (products, blog posts, pages) or to work around the 50,000 URL per file limit. Google supports sitemap index files and processes all referenced child sitemaps.

bottom of page