How to Create and Submit an XML Sitemap: The 2026 Guide
Create, validate and submit an XML sitemap to Google and Bing. Covers sitemap tags, size limits, index files, robots.txt and common mistakes to avoid.

To create and submit a sitemap, you build an XML file of your canonical URLs and give it to search engines. Mastering XML sitemap architecture is essential for ensuring search engines properly discover, crawl, and index your website's core pages. Learning how to submit sitemap to google provides search engine bots with an explicit roadmap of your canonical content, accelerating discovery and streamlining site maintenance.
Key Takeaways: XML Sitemap Best Practices
This summary outlines essential guidelines for designing and submitting sitemaps to search engines.
Establishing a clean XML sitemap architecture prevents indexation gaps and prevents search bots from wasting crawl budget on non-canonical URLs. Implementing strict validation rules prior to engine submission keeps your indexation ratios high across Google and Bing.
- Include only canonical, indexable URLs returning 200 OK status codes in your sitemap files.
- Ensure individual sitemap files do not exceed 50,000 URLs or 50MB uncompressed data limits.
- Submit sitemaps directly in Google Search Console and reference their absolute locations inside your robots.txt file.
- Understand that sitemap submission accelerates content discovery but does not guarantee immediate page indexing.
An Introduction to XML Sitemaps and Why They Matter for SEO
This section explains how search crawlers utilize sitemaps and how XML formats differ from HTML alternatives.
An XML sitemap is a structured machine-readable document listing critical website URLs to assist search engines during content discovery. By supplying machine-readable metadata about your site hierarchy, an XML sitemap helps bots locate critical pages fast, bypassing broken navigation paths or unlinked pages.

How Search Engine Crawlers Use Sitemaps
Crawlers discover new content primarily by parsing hyperlinks across existing pages. However, relying strictly on internal linking presents vulnerabilities. Orphan pages with zero incoming links often remain invisible to crawlers during routine scans. Deeply nested site architectures requiring four or five clicks from the homepage frequently experience lower crawl priority. Brand-new domain names lacking external backlinks face extended delays before initial indexing.
An XML sitemap addresses these discovery hurdles by presenting a direct index of target URLs. While search engines utilize automated algorithms to determine crawl frequency, supplying a validated sitemap ensures no priority page is overlooked during discovery runs.
Distinguishing XML from HTML Sitemaps
It is crucial to distinguish between XML and HTML sitemaps. An XML sitemap targets search engine bots, delivering structured markup, character encodings, and precise update timestamps. An HTML sitemap is built for human site visitors, rendering an interactive page outline that aids visual navigation.
Both sitemaps complement one another, but technical search optimization relies on XML files for automated indexing pipelines. For an absolute primer on search infrastructure, read our guide on how to index website in google fast, and for the wider picture see what technical SEO covers.
Anatomy of an XML Sitemap File
This section breaks down XML tags, schema requirements, and modern engine interpretation of sitemap parameters.
Understanding the strict XML schema standards ensures your file parses correctly without syntax warnings or silent submission failures.
Supported XML Schema Tags Overview
The basic structure of a standard XML sitemap requires specific parent and child tags adhering to the sitemaps.org protocol:
<?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-03-30T08:00:00+00:00</lastmod>
</url>
</urlset>
The <urlset> tag encapsulates the entire file and specifies the standard schema namespace. The <url> tag acts as the parent container for every individual URL entry. The <loc> tag is mandatory; it must contain the full, absolute URL starting with https:// or http://. Relative path strings like /category/product cause syntax errors and lead to submission rejection.
The Modern Role of Lastmod, Changefreq, and Priority
The <lastmod> tag communicates the exact date and time a page was last substantially updated using W3C Datetime format (YYYY-MM-DDThh:mm:ssTZD). Search engine bots evaluate the reliability of your <lastmod> headers over time. If a site updates the timestamp automatically on every server build without real content changes, engines label the field untrustworthy and ignore it completely.
Legacy protocols included optional tags like <priority> (ranging from 0.0 to 1.0) and <changefreq> (such as always, daily, monthly). Modern search engines, including Google, explicitly ignore <priority> and <changefreq> tags. Omitting these legacy tags reduces overall file size and keeps payload footprints lean.
How to Create an XML Sitemap for Any CMS or Stack
This section covers implementation methods across Content Management Systems, custom frameworks, and dynamic web applications.
Generating a reliable sitemap file varies based on whether your site utilizes a content management system, a headless JavaScript framework, or a legacy database back-end.
| CMS / Framework | Native Capability | Top Plugin / Package Option | Default Sitemap Path |
|---|---|---|---|
| WordPress | Built-in native sitemap (/wp-sitemap.xml) | Yoast SEO, Rank Math | /sitemap_index.xml |
| Shopify | Built-in native sitemap | Automatic (System Managed) | /sitemap.xml |
| Wix | Built-in native sitemap | Automatic (System Managed) | /sitemap.xml |
| Squarespace | Built-in native sitemap | Automatic (System Managed) | /sitemap.xml |
| Next.js / React | Requires static build script | next-sitemap package | /sitemap.xml |
| Nuxt / Vue | Requires module execution | @nuxtjs/sitemap module | /sitemap.xml |
WordPress Implementation
WordPress cores natively export a sitemap hierarchy at /wp-sitemap.xml. However, popular search plugins routinely disable core output in favor of custom indices like sitemap_index.xml. These plugins let you automatically exclude internal search results, admin routes, tag archives, and utility pages. The free Digispot AI WordPress plugin also manages sitemaps, a robots.txt editor, llms.txt and IndexNow from the same screen as its SEO audit.
Shopify, Wix, and Squarespace
Hosted SaaS platforms manage sitemaps natively. Shopify automatically updates /sitemap.xml whenever a product, page, collection, or blog post publishes. Wix and Squarespace run similar automated backend background jobs, maintaining the file structure without manual code adjustments.
Build-Step Generation for Custom Frameworks
For modern JAMstack configurations built on Next.js, Nuxt, or Remix, sitemaps should be produced during the build step or generated dynamically at the server edge. In Next.js environments, integrating the open-source next-sitemap package automatically reads server routes post-build, constructs compliant XML outputs into the public root directory, and auto-generates a global index file.
Dynamic Generation for Custom Back-ends
Database-driven web applications running custom PHP, Python, Node, or Go back-ends should generate XML feeds dynamically. Ensure dynamic sitemap outputs employ edge caching strategies to prevent database strain when search engines make frequent concurrent requests.
To visually audit your site architecture before export, test your paths using the Free Sitemap Visualizer & XML Sitemap Viewer Online.

Managing Large Sites: Sitemap Index Files and Media Sitemaps
This section outlines strategies for structuring sitemap indexes and media extensions on large sites.
Enterprise platforms housing tens of thousands of dynamic pages quickly exceed single-file architectural thresholds, requiring modular file splitting.
Structuring a Sitemap Index File
The standard sitemaps protocol sets clear physical constraints for single files: a maximum of 50,000 URLs and an uncompressed file size limit of 50MB. If your website breaches either boundary, you must split your URLs across multiple XML sitemap files and link them using a master sitemap index file.
A sitemap index file uses the <sitemapindex> parent element and lists individual child sitemaps using <sitemap> containers:
<?xml version="1.0" encoding="UTF-8"?>
<sitemapindex xmlns="http://www.sitemaps.org/schemas/sitemap/0.9">
<sitemap>
<loc>https://example.com/sitemap-posts.xml</loc>
<lastmod>2026-03-30T10:00:00+00:00</lastmod>
</sitemap>
<sitemap>
<loc>https://example.com/sitemap-products.xml</loc>
<lastmod>2026-03-30T10:30:00+00:00</lastmod>
</sitemap>
</sitemapindex>
Segmenting sitemap files by logical sections—such as /sitemap-products.xml, /sitemap-categories.xml, and /sitemap-blogs_1.xml—makes diagnosing indexation drop-offs much easier in Search Console.
Specialized Image, Video, and News Extensions
Media-heavy sites benefit from adding media-specific extensions directly inside sitemap entries:
- Image Sitemaps: Help Google discover embedded images hidden behind complex JavaScript loading routines using tags like
<image:image>and<image:loc>. - Video Sitemaps: Provide details like video duration, thumbnail paths (
<video:thumbnail_loc>), play counts, and access restrictions to enhance video carousel eligibility. - Google News Sitemaps: Designed for news publishers, these contain articles published in the last 48 hours using tags like
<news:publication>and<news:publication_date>.
Checklist before you submit: sitemap best practices
This section details critical data validation steps to execute before submitting your sitemap file.
- Verify that every listed URL returns a standard
200 OKstatus code. - Ensure all URLs represent absolute, canonical paths rather than non-canonical variants.
- Exclude redirected URLs, blocked paths, and pages marked with
noindexdirectives. - Confirm the XML sitemap complies with size limits of 50,000 URLs and 50MB uncompressed.
Pre-Submission Checklist: Sitemaps Validation Standards
This section outlines technical requirements to prevent search engine parsing errors and site audit warnings.
Submitting corrupted, incomplete, or unvalidated sitemap files can cause Google Search Console parsing failures and distort your indexation reports.
Clean Data Hygiene Checklist
Before submitting any sitemap URL string to search engine dashboards, run this mandatory diagnostic review:
- 200 OK Status Guarantee: Every single URL listed inside your XML sitemap must return an explicit
200 OKHTTP status header. - Exclude Non-Canonical Target URLs: Never include URLs that feature self-referential canonical tags pointing elsewhere, parameter strings, or soft 404 conditions.
- Zero Redirect Routes: Audit files to purge 301 permanently moved and 302 temporary redirect paths.
- Purge Noindex Directives: Confirm that zero URLs within the sitemap carry meta
noindexrobots tags orX-Robots-Tag: noindexheaders. - Strict Protocol Matching: Match the scheme (
https://vshttp://) and subdomain (wwwvs non-www) to your site's canonical host setup. - Proper Character Escaping: Ensure special characters in URLs use standard XML entity escaping (
&for&,<for<,>for>,"for",'for'). - UTF-8 Encoding Standard: Ensure the sitemap document is saved and served strictly in UTF-8 encoding format.
For step-by-step guidance on resolving redirect errors flagged during sitemap parsing, read our walkthrough on fixing page redirect errors in Search Console, and for requesting indexing see How to Submit URLs to Google for Indexing.
How to Submit Sitemap to Google Search Console
This section walks through the complete workflow for submitting sitemaps to Google Search Console.
Submitting your sitemap directly to Google accelerates initial URL discovery and opens detailed diagnostic reporting inside Search Console.
Step-by-Step GSC Submission Process
Follow these precise steps to submit your validated file:
- Log into your Google Search Console dashboard.
- Select your verified domain or URL-prefix property from the top-left dropdown menu.
- Navigate to the left navigation panel, click under the Indexing section, and select Sitemaps.
- Locate the section labeled Add a new sitemap.
- Type the relative path of your sitemap file (for example,
sitemap_index.xmlorsitemap.xml) into the text box following your domain name prefix. - Click the Submit button to finalize your request.
| Step | Section | Action Required |
|---|---|---|
| 1 | Property Selector | Choose verified domain or URL-prefix property. |
| 2 | Indexing Menu | Click on the Sitemaps sub-menu. |
| 3 | Add a new sitemap | Enter sitemap path (e.g., sitemap_index.xml) and click Submit. |
Troubleshooting "Couldn't Fetch" Errors
After clicking Submit, Google Search Console updates the table under Submitted sitemaps. The status column will update to display one of three primary states:
- Success: Google successfully fetched, parsed, and processed the sitemap without structural syntax errors.
- Has errors: Google fetched the sitemap, but encountered schema issues, unescaped characters, or inaccessible individual URLs.
- Couldn't fetch: Google was blocked from reading the sitemap endpoint.
If Search Console reports "Couldn't fetch," verify that your server is not blocking Googlebot through IP firewalls, WAF rules, or restrictive CDN security filters. Also check that your robots.txt file isn't inadvertently blocking the sitemap file path. See our robots.txt setup guide for the rules.
Adding Your Sitemap to Robots.txt and Submitting to Bing
This section explains how to declare sitemaps in robots.txt and submit them to Bing Webmaster Tools.
Submitting your sitemap across multiple engine infrastructures ensures discovery across global and regional search indexes.
Declaring Sitemaps in Robots.txt
The robots.txt file acts as the primary instruction point for search crawlers accessing your site. Declaring your absolute sitemap directive inside your robots.txt file allows bots to automatically discover your sitemap path upon entering your domain.
Add the sitemap line at the bottom of your robots.txt file using its absolute URL. To check a live robots.txt and sitemap on one page, the free Digispot AI Chrome extension tests both and flags a missing or broken file:
User-agent: *
Disallow: /admin/
Disallow: /cart/
Sitemap: https://example.com/sitemap.xml
If your platform relies on multiple index files (such as localized sitemaps or media extensions), declare each absolute sitemap URL on a separate line:
Sitemap: https://example.com/sitemap-posts.xml
Sitemap: https://example.com/sitemap-products.xml
Bing Webmaster Tools Submission
Expanding engine coverage beyond Google ensures visibility across Bing, Yahoo, and DuckDuckGo ecosystem queries.
- Access your Bing Webmaster Tools portal and select your verified website property.
- Click on Sitemaps in the left-hand navigation bar.
- Click the Submit sitemap button located in the upper-right corner.
- Input your complete absolute XML sitemap URL (e.g.,
https://example.com/sitemap.xml). - Click Submit to finalize engine indexing entry.
Advanced Configurations: Multi-Language Hreflang Sitemaps
This section covers XML implementations for multi-regional sites requiring hreflang annotations.
International platforms managing multi-regional or multi-language content can specify localized target URLs using XML sitemap extensions.
Embedding Hreflang Tags in XML Architecture
Instead of cluttering HTML document <head> blocks with dozens of code lines, you can embed rel="alternate" hreflang annotations directly inside your XML sitemap entries:
<?xml version="1.0" encoding="UTF-8"?>
<urlset xmlns="http://www.sitemaps.org/schemas/sitemap/0.9"
xmlns:xhtml="http://www.w3.org/1999/xhtml">
<url>
<loc>https://example.com/en/page</loc>
<xhtml:link rel="alternate" hreflang="en" href="https://example.com/en/page" />
<xhtml:link rel="alternate" hreflang="es" href="https://example.com/es/page" />
<xhtml:link rel="alternate" hreflang="x-default" href="https://example.com/en/page" />
</url>
<url>
<loc>https://example.com/es/page</loc>
<xhtml:link rel="alternate" hreflang="en" href="https://example.com/en/page" />
<xhtml:link rel="alternate" hreflang="es" href="https://example.com/es/page" />
<xhtml:link rel="alternate" hreflang="x-default" href="https://example.com/en/page" />
</url>
</urlset>
Our hreflang guide for international SEO explains the full rules. This setup requires cross-referencing: every language version must link to itself and all other regional variants, including an x-default landing page for unmatched regions.
Audit and maintain
This section covers routine processes for auditing sitemap entries and keeping search engines updated.
- Run periodic audits to locate dead links or 404 errors inside XML sitemaps.
- Remove canonical redirects and non-indexable URLs promptly.
- Ensure new content paths register automatically within active sitemaps.
Auditing and Maintaining Your Sitemap Health
This section explains how to diagnose indexing discrepancies and keep sitemap files synced with live site status.
Maintaining a clean XML sitemap requires continuous automated monitoring to ensure new pages enter the file automatically while broken URLs are removed immediately.
Diagnosing Discrepancies in Search Console
Regularly compare the total number of URLs submitted in your sitemap against the indexed count reported in Google Search Console's Page Indexing report.
If you observe a significant gap where submitted URLs remain unindexed, use the Search Console filtering options:
- Filter the Page Indexing status table by selecting All submitted pages.
- Review the excluded categories, such as Discovered - currently not indexed, Crawled - currently not indexed, or Page with redirect.
- Purge redirected and non-canonical pages from your sitemap files to present Googlebot with a clean indexable URL set.
To find every URL in a sitemap that redirects, errors or is blocked, run a real-browser crawl with the Digispot AI SEO Spider, which ranks issues by severity with fix steps. Performing routine monthly site audits keeps your content architecture lean, preserving crawl budget for priority money pages.
More in the Technical SEO guide
This section highlights additional resources for mastering technical optimization strategies.
- Explore crawling mechanics in our crawl budget guide for large sites.
- Master canonical tag implementations in What Is a Canonical URL.
- Review the full technical SEO guide for rendering and site architecture.
Keep Your Sitemap Healthy with Digispot AI
A sitemap only helps while it lists the right URLs. The free Chrome extension checks robots.txt and sitemap files on any page, the SEO Spider crawls the whole site in a real browser, and Site Architecture Insights in the Cloud app reviews robots.txt, sitemap and llms.txt over time. One Digispot AI plan covers every tool, so agencies and in-house teams do not pay per tool.
To inspect your current sitemap structure and spot orphan pages, try the free Sitemap Visualizer & XML Sitemap Viewer.
More in the Technical SEO guide
Start with the What Is Technical SEO? A Complete Guide.
Audit any page in seconds
200+ SEO checks including Core Web Vitals, schema markup, meta tags, and AI readiness — trusted by 1,250+ SEO experts and marketers.
Frequently Asked Questions
Here are some of our most commonly asked questions. If you need more help, feel free to reach out to us.

Maya Krishnan is an SEO and AEO specialist at Digispot AI. She helps agencies and businesses across industries and countries grow organic traffic from Google and AI search, and knows the major SEO platforms well, from desktop crawlers to all-in-one suites. She checks and approves every article published under her name.
More from Maya Krishnan

