XML Sitemap: How to Create and Submit It to Google
An XML sitemap is a file that lists the URLs on your website and signals to search engines which pages you want crawled and indexed. It does not guarantee indexing — Google decides what it actually crawls — but a properly structured sitemap removes ambiguity and makes the crawl process significantly more efficient. For any site with more than a handful of pages, an XML sitemap is a non-negotiable technical SEO foundation.
⠀
Why Google Needs Your Sitemap
⠀
Google discovers pages through two methods: following links and reading sitemaps. Links work well for well-connected pages, but they leave gaps. Orphan pages (pages with no internal links pointing to them), deeply nested content, recently published URLs, and pages behind filters all risk being missed by Googlebot if you rely solely on link discovery.
A sitemap acts as a direct communication channel. It tells Googlebot: "These URLs exist, they are canonical, and here is when they were last updated." Google uses that <lastmod> timestamp — when accurate — to prioritize recrawling. Sites that update content frequently benefit most, because Googlebot can allocate its crawl budget more intelligently when it knows which pages have changed.
At Blakfy, we routinely audit client sitemaps before any other technical work. A bloated or misconfigured sitemap is one of the fastest ways to signal poor site health to Google — and it is one of the easiest things to fix.
⠀
What to Include in Your XML Sitemap
⠀
Only include URLs that you want Google to index. That sounds obvious, but in practice most sitemaps contain URLs that should never have been included. A clean sitemap should contain:
Canonical, indexable pages — every URL in the sitemap should be the canonical version and must not carry a noindex directive
Pages with real content value — landing pages, blog posts, product pages, category pages
The correct protocol — always use https:// URLs, never http://
Consistent URL format — trailing slash or no trailing slash, consistently applied across all entries
⠀
The <priority> tag (0.0 to 1.0) and <changefreq> tag are largely ignored by Google today. You can include them for completeness, but do not invest time tuning them — they have no meaningful effect on crawl behavior.
⠀
What to Exclude from Your Sitemap
⠀
Including low-quality or restricted URLs in your sitemap is actively harmful. Googlebot interprets a URL's presence in a sitemap as a recommendation. Send it the wrong pages and you waste crawl budget and dilute your site's quality signal. Exclude:
Noindex pages — pages with <meta name="robots" content="noindex"> or an X-Robots-Tag: noindex header should never appear in a sitemap. Including both is a direct contradiction.
Redirect URLs — 301 and 302 redirect sources should not be in your sitemap. Only include the final destination URL.
Duplicate content — parameter-generated URLs, session IDs, printer-friendly pages, and pagination variants that duplicate the canonical version
Admin, login, and checkout pages — these provide no indexing value and often should be blocked in robots.txt as well
Soft 404s — pages that return a 200 status code but show "no results" or empty content
⠀
⠀
Image and Video Sitemaps
⠀
Google supports image sitemaps and video sitemaps as extensions of the standard XML format. An image sitemap uses the <image:image> namespace to declare images associated with a page, which can improve image search discovery. A video sitemap uses <video:video> to provide metadata (title, description, thumbnail URL, duration) that helps Google index video content accurately.
Image sitemaps are particularly valuable for e-commerce sites and photography portfolios where visual content drives traffic. If your product images are not showing up in Google Image Search, an image sitemap is often the fix.
⠀
Sitemap Size Limits
⠀
Google enforces hard limits on sitemap files. A single sitemap file cannot exceed 50,000 URLs or 50 MB (uncompressed). If your site exceeds these limits, you must split your sitemap into multiple files and reference all of them from a sitemap index file — an XML file that lists the locations of each individual sitemap file.
Large e-commerce sites typically maintain multiple sitemaps by content type: one for product pages, one for categories, one for blog posts. This structure also makes it easier to monitor indexing rates by content type in Google Search Console.
⠀
How to Generate an XML Sitemap
⠀
WordPress with Yoast SEO
⠀
Yoast SEO generates and maintains your sitemap automatically. After installing the plugin, navigate to SEO > General > Features and confirm the XML sitemaps toggle is enabled. Your sitemap will be accessible at yourdomain.com/sitemap_index.xml. Yoast allows you to exclude specific post types, taxonomies, or individual pages from the sitemap directly from the plugin settings.
Wix
⠀
Wix generates an XML sitemap automatically for all published sites. It is located at yourdomain.com/sitemap.xml and updates dynamically as you add or remove pages. You do not need a third-party tool — but you should verify the sitemap is accessible and contains your expected URLs.
Shopify
⠀
Shopify auto-generates a sitemap at yourdomain.com/sitemap.xml. It includes products, collections, blog posts, and pages by default. Shopify does not offer fine-grained control over sitemap contents natively; if you need to exclude specific URLs, a third-party app or custom liquid modifications are required.
Static Sites and Custom Builds
⠀
For static site generators (Next.js, Gatsby, Hugo) or custom-built sites, you can generate sitemaps programmatically using libraries like next-sitemap for Next.js, or create the XML file manually for smaller sites. Always validate the output against Google's sitemap guidelines before submitting.
⠀
Dynamic vs. Static Sitemaps
⠀
A static sitemap is a pre-generated XML file that you update manually or through a scheduled script. It works fine for small sites that do not change frequently. A dynamic sitemap is generated on the fly by your CMS or server each time it is requested. Dynamic sitemaps are always current but can add server load on large sites.
Most modern CMS platforms (WordPress, Wix, Shopify) generate dynamic sitemaps. For high-traffic sites with thousands of pages, it is worth caching the sitemap response rather than regenerating it on every request.
⠀
How to Submit Your Sitemap via Google Search Console
⠀
Go to Google Search Console and select your property.
In the left sidebar, navigate to Indexing > Sitemaps.
In the "Add a new sitemap" field, enter the path to your sitemap (e.g., sitemap_index.xml).
Click Submit.
⠀
Google will attempt to fetch and process your sitemap immediately. The status column will show "Success" if the sitemap was read without errors, along with counts for discovered and indexed URLs. If the sitemap shows errors, click through for details — common issues include URLs that return non-200 status codes or malformed XML.
You can submit multiple sitemaps for a single property, which is useful when using separate sitemaps for different content types. Resubmitting a sitemap after major content updates is good practice, as it prompts a faster recrawl.
⠀
How Often Does Google Recrawl a Sitemap?
⠀
Google does not recrawl sitemaps on a fixed schedule. Googlebot recrawls based on its own crawl budget allocation, the <lastmod> values in your sitemap, and the perceived popularity and authority of your site. High-authority sites with fresh content can see recrawl intervals measured in hours. Low-authority sites may wait days or weeks between recrawls.
The most effective way to signal urgency is to keep <lastmod> accurate — only update it when a page's content has genuinely changed. Inflating <lastmod> dates to force recrawls is a tactic that Google's documentation explicitly warns against and can result in your sitemap timestamps being ignored entirely.
⠀
⠀
FAQ
⠀
Does submitting a sitemap guarantee my pages will be indexed?
No. Submitting a sitemap tells Google where your pages are, but Google decides independently whether to index them based on quality, authority, and relevance signals. A sitemap speeds up discovery but does not override Google's indexing judgments.
Should I include noindex pages in my sitemap?
Never. A page with a noindex directive should not appear in your sitemap. The two signals contradict each other — including a URL in the sitemap says "index this," while noindex says "do not." Google will generally follow the noindex instruction, but the contradiction can slow down processing and create confusion in your coverage report.
What happens if my sitemap has errors?
Google Search Console will show an error status and provide details about what went wrong. Common errors include unreachable URLs (404s, redirects), malformed XML, and URLs that violate size limits. Fix the underlying issues and resubmit. Errors do not cause ranking penalties directly, but they mean Google is not processing your sitemap correctly.
How many URLs should a sitemap file contain?
Up to 50,000 URLs per file. For sites with more URLs, create multiple sitemap files and reference them from a sitemap index file. Keeping individual sitemaps under 10,000 URLs each makes them easier to monitor and debug in Search Console.



