XML Sitemap Guide: How to Create, Optimise, and Submit Your Sitemap to Google

An XML sitemap is a file listing the URLs you want search engines to discover – a table of contents you hand to Google. Include only canonical, indexable pages (200 status, not noindex, not blocked); exclude tag pages, author archives, search results, and redirects. Keep each file under 50,000 URLs and 50 MB; beyond that, use a sitemap index. Submit it in Google Search Console and reference it in robots.txt. Crucially: a sitemap helps Google discover pages – it does not guarantee indexing. Google still decides that independently, which is why the submitted-versus-indexed gap is the most useful thing a sitemap shows you.

An XML sitemap is one of the oldest tools in SEO and one of the most consistently misconfigured. Most guides make two mistakes: they tell you to fill in tags Google stopped using years ago, and they imply that submitting a sitemap gets your pages indexed. Neither is true, and clearing both up is where real sitemap skill begins.

This is the full deep-dive into Step 1 of the technical SEO strategies guide on GrowWithSakib. If you’re still getting your bearings, what technical SEO actually is on GrowWithSakib sets the scene.

What an XML Sitemap Actually Does (and Doesn’t)

A sitemap aids discovery, not indexing. It tells Google which URLs exist and are worth crawling – especially useful for new sites, large sites, and orphan pages with few internal links. But Google decides indexing independently, based on content quality, duplication, and perceived value.

So a sitemap can get a page crawled quickly. It cannot force that page to be indexed. Anyone who tells you a sitemap guarantees indexing is selling the wrong idea – and you’ll waste weeks wondering why perfectly-submitted pages never appear.

Held correctly, that idea reframes everything. The sitemap’s job is to make discovery efficient and to give you a diagnostic surface in Search Console. It is not a magic “index me” button. Everything below serves those two real purposes.

What to Include – and What to Exclude

The golden rule: a sitemap should contain only the URLs you want indexed, and nothing else. Every junk URL you include dilutes the signal and wastes crawl budget. A good test – if you’d be unhappy seeing a page in Google’s results, it doesn’t belong in your sitemap.

Include (canonical, indexable)Exclude (dilutes the signal)
Key landing and service pagesTag pages and thin taxonomy archives
Blog posts and articlesAuthor archive pages (especially single-author blogs)
Products and product categoriesInternal search results pages
Important static pages (About, Contact)noindex pages of any kind
Cornerstone and pillar contentRedirected URLs (list the destination instead)
Canonical version of each page4xx / 404 and blocked (robots.txt) URLs

Tag pages – WordPress generates a thin archive for every tag. Dozens of near-empty pages, all in your sitemap by default.

Author archives – on a single-author blog, these duplicate your main blog feed exactly. Pure dilution.

Search results – internal search URLs are infinite and worthless to index. Google explicitly discourages indexing them.

Left unchecked, these can make up the majority of a WordPress sitemap – burying your real pages in noise.

The Technical Limits You Must Respect

RuleThe LimitWhat to Do
URLs per file50,000 maximumSplit into multiple files beyond this
File size50 MB uncompressedSplit, or compress with gzip
When you exceed eitherUse a sitemap index file pointing to child sitemaps
URL formatAbsolute URLs onlyFull https:// URLs, never relative paths
LocationRoot is bestyourdomain.com/sitemap.xml, not a subfolder

What a Sitemap Actually Looks Like

A basic sitemap is simpler than people expect. Each URL needs a <loc>; an accurate <lastmod> is a useful bonus:

<?xml version=”1.0″ encoding=”UTF-8″?> <urlset xmlns=”http://www.sitemaps.org/schemas/sitemap/0.9″> <url> <loc>https://example.com/</loc> <lastmod>2026-07-10</lastmod> </url> <url> <loc>https://example.com/services/</loc> <lastmod>2026-06-22</lastmod> </url> </urlset>

For a large site, a sitemap index points to multiple child sitemaps, usually split by content type:

<?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-07-10</lastmod> </sitemap> <sitemap> <loc>https://example.com/sitemap-pages.xml</loc> <lastmod>2026-06-22</lastmod> </sitemap> </sitemapindex>

You’ll see older guides tell you to add <changefreq> and <priority> tags to every URL. Don’t bother. Google openly ignores both – it crawls based on its own signals, not your self-assigned priorities. They add clutter and a false sense of control. If you want to signal importance, your internal linking and site structure do it far more credibly.

The <lastmod> tag does matter – Google uses it to prioritise recrawling – but only if it’s honest. If your CMS stamps every URL with today’s date, or you fake dates to chase attention, Google notices and starts ignoring lastmod across your whole site. Use the real content-modified date, in ISO 8601 format (2026-07-10), and never update it unless the page genuinely changed.

A client’s blog had grown for years on WordPress with no sitemap discipline. When we opened their sitemap, it held over 40,000 URLs – for a site with perhaps 600 real articles.

The other 39,000-plus were tag pages, author archives, paginated comment URLs, and attachment pages, all generated automatically and all included by default. Their genuinely valuable content was a needle in a haystack of thin, near-duplicate URLs, and Google was spending its crawl budget wading through the noise.

We reconfigured their SEO plugin to exclude the lot, and the sitemap dropped to around 600 URLs – the ones that actually mattered. Within weeks, new articles were being discovered and indexed noticeably faster. Nothing about the content changed. We’d simply stopped hiding it.

How to Create Your Sitemap (WordPress and Beyond)

You almost never build a sitemap by hand. The method depends on your platform:

Both plugins auto-generate a sitemap index (usually at /sitemap_index.xml) and split it into child sitemaps for posts, pages, categories, tags and custom post types. They update it automatically whenever you publish or edit. The setup that matters is what you turn off:

  • Rank Math: Sitemap Settings, then disable the tag, author, and any thin taxonomy sitemaps you don’t want indexed. Toggle post types on or off individually.
  • Yoast SEO: under Search Appearance, set author archives, tags, and formats to “noindex” – Yoast then automatically removes them from the sitemap.
  • Either way: the key insight is that noindex and sitemap inclusion are linked in these plugins – mark something noindex and it drops out of the sitemap, exactly as it should.

For deeper plugin configuration, see the WordPress SEO setup guidance on GrowWithSakib.

  • Shopify, Wix, Squarespace: generate a sitemap automatically at /sitemap.xml – nothing to install.
  • Next.js / static sites: use a build-time generator (like the next-sitemap package) and exclude private paths such as /admin/*.
  • Custom sites: generate programmatically from your database, including only canonical 200-status URLs. Validate with a crawler like Screaming Frog before deploying.
Recommended Hosting Partner

Is Your WordPress Hosting Ready for SEO Growth?

Choose a reliable hosting foundation that supports website performance, security, and long-term SEO growth.

  • WordPress Hosting
  • SSL Included
  • 24/7 Support
  • Reliable Speed
Explore Hostinger
Affiliate disclosure: We may earn a commission at no extra cost to you.

How to Submit Your Sitemap to Google

Once your sitemap is clean, submitting it in Google Search Console on GrowWithSakib takes about a minute:

  1. Find your sitemap URL (on WordPress, usually yourdomain.com/sitemap_index.xml). Open it in a browser to confirm it loads.
  2. In Google Search Console, open Indexing, then Sitemaps in the left menu.
  3. Enter your sitemap path in the ‘Add a new sitemap’ field and click Submit.
  4. Reference it in robots.txt too, so every crawler finds it: add the line Sitemap: https://yourdomain.com/sitemap_index.xml
  5. Check back in a few days: Search Console will report ‘Success’ and how many URLs it discovered.

Add a single line to your robots.txt file on GrowWithSakib:

Sitemap: https://yourdomain.com/sitemap_index.xml

This lets every crawler – Google, Bing, and AI crawlers like GPTBot and PerplexityBot – discover your sitemap without you submitting it to each one. It’s the single easiest win in this whole guide.

The Real Diagnostic: Submitted vs Indexed

This is where the sitemap earns its keep, and where the “discovery, not indexing” idea pays off. In Search Console’s Pages report (and the per-sitemap view), you’ll see two very different numbers: how many URLs you submitted, and how many Google actually indexed. The gap between them is a diagnosis.

What You SeeWhat It MeansWhat to Do
Submitted approx equals indexedHealthy. Google values your pagesNothing – this is the goal
Many ‘Crawled – not indexed’Google saw them but judged them low-valueImprove content depth, quality, uniqueness
Many ‘Discovered – not indexed’Google is holding off crawling (often crawl budget)Improve site speed, internal links, reduce bloat
‘Excluded by noindex’Correct IF intended; a bug if notCheck the page shouldn’t be indexed
Sitemap ‘Couldn’t fetch’Google can’t read the fileCheck the URL, format, and robots.txt access

The two most common – Crawled currently not indexed and Discovered currently not indexed – are not sitemap problems. They’re content and site-quality signals, and worth checking as part of a full technical SEO audit on GrowWithSakib. No sitemap edit fixes them; better, more distinct content and stronger internal linking do. That’s the sitemap doing its real job: not indexing your pages, but telling you why they aren’t.

A client emailed in a mild panic: Search Console said 300 pages submitted, only 90 indexed, and they were convinced the sitemap was broken.

The sitemap was fine. The 210 unindexed URLs were almost all ‘Crawled – currently not indexed’, and when we looked, the reason was obvious: they were thin location pages, near-identical except for a swapped town name. Google had crawled them, decided they added nothing, and declined to index – exactly as designed.

The fix had nothing to do with the sitemap. We consolidated the doorway pages into a few genuinely useful regional guides, and those got indexed within weeks. The sitemap hadn’t failed – it had told them, precisely, which pages Google didn’t think were worth keeping.

Keeping It Healthy

  • Let it update automatically – a static, hand-maintained sitemap is stale within days. Dynamic generation is the default for any site that publishes regularly.
  • Keep sitemap and robots.txt in agreement – never list a URL in your sitemap that robots.txt blocks. That contradiction wastes crawl budget and confuses Google.
  • Match canonical URLs exactly – every sitemap URL should match that page’s canonical tag, character for character (trailing slashes included).
  • Audit quarterly – and always after a migration, plugin change, or URL restructure. That’s when sitemaps quietly break.

Common XML Sitemap Mistakes

MistakeWhy It HurtsDo This Instead
Including tag/author/search pagesDilutes the signal, wastes crawl budgetExclude them; list only index-worthy URLs
Setting changefreq and priorityGoogle ignores both entirelySkip them; use accurate lastmod only
Faking or uniform lastmod datesGoogle ignores lastmod site-wideUse the real content-modified date
Listing noindex or redirected URLsSends Google contradictory signalsList only canonical, 200-status URLs
Sitemap and robots.txt disagreeContradictory crawl signalsNever list a URL robots.txt blocks
Expecting a sitemap to force indexingIt only aids discoveryFix content quality for ‘not indexed’ pages
Never checking Search ConsoleYou miss the submitted-vs-indexed gapRead the Pages report regularly
One giant file over 50,000 URLsExceeds Google’s hard limitUse a sitemap index with child files

Pages Submitted But Not Getting Indexed?

A sitemap that’s bloated with tag pages and author archives, or a batch of pages stuck on ‘Crawled – not indexed’, are among the most common – and most misdiagnosed – technical SEO problems. The sitemap is rarely the real issue; it’s usually pointing at a content or crawl-budget problem underneath.

At GrowWithSakib, we clean up sitemaps properly: excluding the noise, fixing the submission and robots.txt setup, and reading the submitted-versus-indexed gap to tell you what’s actually keeping your pages out of Google – then fixing that.

Frequently Asked Questions

What is an XML sitemap and do I need one?

An XML sitemap is a file listing the URLs on your site you want search engines to discover and index – a structured table of contents you hand directly to Google. You need one because it helps crawlers find your content efficiently, especially on new sites, large sites, and pages with few internal links pointing to them. Even a small, well-linked site benefits: a sitemap costs nothing, speeds up discovery of new pages, and gives you a valuable diagnostic surface inside Google Search Console.

What should I exclude from my XML sitemap?

Exclude anything you wouldn’t want appearing in Google’s results. The usual culprits on WordPress are tag pages (thin taxonomy archives), author archives (which duplicate your blog feed on single-author sites), and internal search results. Also exclude any noindex pages, redirected URLs (list the destination instead), and anything returning a 404 or blocked by robots.txt. The rule is simple: a sitemap should list only canonical, indexable, 200-status URLs you genuinely want indexed. Everything else dilutes the signal.

How do I submit my sitemap to Google?

Open Google Search Console, go to Indexing then Sitemaps in the left menu, enter your sitemap path (on WordPress usually sitemap_index.xml) in the ‘Add a new sitemap’ field, and click Submit. Then add a line to your robots.txt file – Sitemap: https://yourdomain.com/sitemap_index.xml – so every crawler can discover it automatically. Check back after a few days: Search Console will report success and how many URLs it found. Referencing it in robots.txt also lets Bing and AI crawlers find it without separate submission.

Why are my sitemap pages submitted but not indexed?

Because a sitemap only aids discovery – it doesn’t force indexing, which Google decides independently. If Search Console shows pages as ‘Crawled – currently not indexed’, Google saw them but judged them low-value, usually due to thin or duplicate content; the fix is better, more distinct content, not a sitemap edit. If they’re ‘Discovered – currently not indexed’, Google is delaying crawling, often a crawl-budget issue you address with faster pages, stronger internal links, and less site bloat. The gap between submitted and indexed is a content signal, not a sitemap fault.

Should I use changefreq and priority tags?

No. Google has stated openly that it ignores both the changefreq and priority tags, and has for years – it crawls based on its own signals rather than your self-assigned values. Adding them creates clutter and a false sense of control. The one metadata tag still worth including is lastmod, and only when it reflects the genuine date a page’s content last changed. If you want to signal which pages matter most, do it through internal linking and site structure, which Google actually weighs.

What is a sitemap index file and when do I need one?

A sitemap index is a master file that points to multiple child sitemaps, rather than listing individual URLs itself. You need one when your site exceeds a single file’s limits – 50,000 URLs or 50 MB uncompressed – or simply when you want to organise URLs by type for easier diagnosis. Most large sites split into child sitemaps for posts, pages, products, and categories. You submit just the index file to Search Console, and Google discovers all the child sitemaps from it. WordPress SEO plugins create this structure automatically.

Rank Math or Yoast for WordPress sitemaps?

Both generate a clean sitemap index automatically and update it whenever you publish or edit, so either works well. The practical difference is in configuration. In Rank Math, you control the sitemap directly under Sitemap Settings, toggling post types and disabling tag or author sitemaps. In Yoast, sitemap inclusion is tied to indexing settings: mark author archives, tags, or formats as ‘noindex’ under Search Appearance and Yoast removes them from the sitemap automatically. Choose based on your wider plugin preference; for sitemaps specifically, they’re comparable.

How often should I update my XML sitemap?

Ideally never by hand – it should update automatically. On WordPress, Rank Math and Yoast regenerate the sitemap the moment you publish, edit, or delete a page, so new content appears within minutes. A static, manually-maintained sitemap goes stale within days and defeats the purpose. What you should do periodically is audit it: check quarterly, and always after a migration, plugin change, or URL restructure, since those are exactly the moments a sitemap quietly breaks or starts including URLs it shouldn’t.

Key Takeaways

  • An XML sitemap aids discovery, not indexing. It tells Google which URLs exist and are worth crawling – but Google still decides indexing independently.
  • Include only canonical, indexable, 200-status URLs. Exclude tag pages, author archives, search results, noindex pages, redirects, and 404s.
  • On WordPress, tag and author pages are the biggest culprits – left in by default, they can outnumber your real content and bury it.
  • Google ignores changefreq and priority entirely. Don’t set them. Use an accurate lastmod – and only ever the genuine content-modified date.
  • Faking or uniformly stamping lastmod makes Google ignore the field across your whole site. Honesty is the whole point of it.
  • Keep each file under 50,000 URLs and 50 MB. Beyond that, use a sitemap index pointing to child sitemaps split by content type.
  • Submit in Search Console and reference it in robots.txt with one line – that lets Google, Bing, and AI crawlers all discover it.
  • The submitted-vs-indexed gap in Search Console is the real payoff: ‘Crawled – not indexed’ is a content-quality signal, not a sitemap fault.