How to Create an XML Sitemap (2026 Guide) for Better SEO and Faster Indexing
Mika Sandgrove | | 5 min read

Creating an XML sitemap is a practical, low-effort way to help search engines discover, crawl, and index your most important pages—especially on large sites, new sites, or sites with complex navigation. In this 2026 walkthrough, you’ll learn how to create an XML sitemap that reflects modern CMS realities, focuses on the tags that matter, and shows exactly how to submit and monitor it in Google Search Console.
Why is an XML Sitemap Important?
An XML sitemap is a machine-readable list of URLs you want search engines to consider for crawling and indexing. It doesn’t guarantee rankings, but it can improve discovery and reduce ambiguity about what you consider “in scope” for indexing.
Industry guidance and recent studies indicate sitemaps are most helpful when:
- Your site has deep architecture (important pages are several clicks from the homepage)
- You publish frequently (news, blogs, product catalogs)
- You have many URLs that are easy to miss via crawling alone (faceted navigation, seasonal collections)
- You’re cleaning up duplicates and want search engines to focus on canonical pages
Step 1: Identify the Pages to Include
Before you generate anything, decide what deserves to be in the sitemap. A strong sitemap is curated—think “indexable, canonical, high-value.”
Include:
- Canonical URLs that return 200 OK
- Core category and product/service pages
- High-performing articles and evergreen resources
- Key location pages (if they’re unique and not thin)
Exclude:
- Duplicate pages (HTTP vs HTTPS, www vs non-www, trailing slash variants)
- Parameter URLs (e.g.,
?sort=price,?utm_source=) and session IDs - Thin or utility pages (internal search results, tag archives you don’t want indexed)
- Paginated duplicates when the canonical points elsewhere
- Any URL blocked by
robots.txtor markednoindex
If you’re unsure whether a URL is truly canonical, aligning your sitemap with your canonical strategy is critical—understanding canonical URL best practices helps prevent “submitted URL not selected as canonical” issues later.
Step 2: Generate the XML Sitemap (WordPress + Modern CMS Options)
In 2026, most modern CMS platforms and SEO plugins generate sitemaps automatically. On WordPress, you’ll typically use an SEO plugin rather than a standalone sitemap tool.
Common WordPress options:
- Yoast SEO: Generates a sitemap index by default
- Rank Math: Generates sitemaps and lets you toggle post types/taxonomies
- Google XML Sitemaps (legacy): Still seen on older installs, but less common on modern stacks
What to do:
- In your SEO plugin settings, ensure XML sitemaps are enabled.
- Verify the sitemap URL your site outputs. The most common patterns are:
https://example.com/sitemap_index.xml(often a sitemap index)https://example.com/sitemap.xml(sometimes a single sitemap)
- Open the URL in your browser. You should see a valid XML file (or a sitemap index listing multiple sitemaps like posts/pages/products).
For custom or headless sites, generate sitemaps server-side (or via your framework) and host them on a stable URL. The key is consistency: don’t change sitemap locations frequently unless you also update Search Console.
Step 3: Structure Your XML Sitemap (What Actually Matters)
A modern XML sitemap can include several tags, but search engines tend to rely most on a few fundamentals.
Prioritize:
- Accurate
<loc>: Use clean, canonical URLs (final destination, not temporary variants). - Accurate
<lastmod>: This is the most useful optional field when it reflects meaningful content changes. Don’t auto-update<lastmod>for every minor template tweak or tracking parameter change. - Sitemap size management: Keep within common limits (up to 50,000 URLs and 50MB uncompressed per sitemap). If you exceed that, split into multiple sitemaps and use a sitemap index.
De-emphasize:
<changefreq>and<priority>: Major search engines largely ignore or heavily discount these signals. Including them won’t usually hurt, but they rarely improve crawling outcomes compared to accurate canonicals, internal linking, and reliablelastmod.
Practical example:
- If you run an ecommerce site, you might have separate sitemaps for
/product-sitemap.xml,/category-sitemap.xml, and/blog-sitemap.xml, all referenced fromsitemap_index.xml.
Step 4: Submit Your Sitemap to Search Engines (Search Console + Bing)
Once you can access the sitemap URL, submit it.
Google Search Console
- Open Search Console and select the correct property (Domain or URL-prefix).
- Go to Indexing → Sitemaps.
- Enter your sitemap path (e.g.,
sitemap_index.xmlorsitemap.xml). - Click Submit.
Bing Webmaster Tools
- Add your site (or import from Search Console), then submit the same sitemap URL in Bing’s sitemap submission area.
If you use a sitemap index, submit the index—not each child sitemap—unless you have a specific reason to isolate monitoring.
Step 5: Monitor and Update As Needed
Submitting is the start. The real value comes from monitoring whether your sitemap is being fetched, parsed, and translated into indexed pages.
In Google Search Console, check:
- Sitemap status: “Success” vs fetch/parse errors
- Last read date: confirms Google is retrieving it
- Submitted vs indexed counts: a gap is normal, but large gaps signal quality or technical issues
- Indexing/Coverage-style issues tied to sitemap URLs
Common causes when submitted URLs don’t index (and what to verify next):
- Blocked by
robots.txt: the URL is in the sitemap but disallowed from crawling noindexpresent: meta robots or X-Robots-Tag prevents indexing- 404/5xx errors: broken URLs or unstable hosting
- Redirect chains: sitemap lists a URL that redirects multiple times; update sitemap to the final 200 URL
- Canonical mismatches: sitemap URL isn’t the canonical version (e.g., you submitted a parameter URL but canonical points to a clean URL)
As your site changes, keep the sitemap aligned with what you want indexed. When you add new sections, migrate URLs, or prune thin pages, revisit your sitemap rules so it continues to reflect your best content.
In short: if you want to create an XML sitemap that supports faster indexing and cleaner technical SEO, focus on canonical, indexable URLs, accurate lastmod, sensible sitemap splitting, and consistent submission + monitoring in Search Console.
Article author
Mika Sandgrove
Mika Sandgrove is an SEO writer and independent SEO consultant with more than three years of experience creating and optimizing content for search. He runs his own SEO practice, helping businesses improve their organic visibility through SEO strategy, content optimization, and technical and on-page SEO services. Much of his work comes through freelance marketplaces and online client platforms, where he works with businesses across different industries and markets. Mika primarily writes about SEO, search visibility, and practical optimization strategies, and is increasingly exploring Answer Engine Optimization (AEO) and how businesses can adapt their content for AI-powered search experiences.

