ServicesFree AuditWorkInspirationBlogAbouthello@optimaflow.id
← All articles

Technical SEO · 2026-07-29

XML Sitemaps: What to Include and What to Leave Out

An XML sitemap should list only canonical, indexable, 200-status URLs you want ranked—and exclude noindex, redirects, 404s, and duplicates.

XML Sitemaps: What to Include and What to Leave Out

TL;DR

An XML sitemap should include only your canonical, indexable, 200-status URLs that you want in search results—key product, category, blog, and landing pages. Leave out noindex pages, redirects, 404s, duplicates, paginated URLs, filtered parameter pages, and admin or thank-you pages. Keep it to URLs that earn organic traffic.

Think of your sitemap as a curated list, not a full inventory. Include the pages you'd be happy to see ranking on Google tomorrow: money pages, evergreen blog posts, category and collection pages, and any URL that converts or drives traffic. Every URL should return a 200 status, be self-canonical, and be crawlable in robots.txt. If you wouldn't submit it to a customer, don't submit it to Googlebot.

Leave out anything that sends a mixed signal. That means noindex pages, URLs blocked by robots.txt, 301/302 redirects, soft and hard 404s, staging URLs, internal search results, cart and checkout pages, login and account pages, and thin filter or sort variants like ?color=blue&sort=price. Including these wastes crawl budget and tells search engines you're not sure which version matters.

The single rule that catches most problems: only list the canonical version of each URL. If page A canonicalizes to page B, only B belongs in the sitemap. When your sitemap, canonical tags, and internal links all point to the same URL, you give one clean signal. When they disagree, Google picks for you—and often picks wrong. Run a crawl in Screaming Frog and cross-check 'Sitemap' vs 'Canonical' columns to spot the conflicts.

Shopify merchants get an auto-generated sitemap.xml that updates as you add products—but it's not selective. It includes products hidden from collections and sometimes pages you'd rather not surface. Shopify won't let you edit the core sitemap directly, so control indexing at the page level with theme.liquid noindex logic or an app like Sitemapper/SearchPie, then confirm the excluded URLs actually drop out in Search Console.

Respect the hard limits: one sitemap file caps at 50,000 URLs and 50MB uncompressed. Past that, split into multiple sitemaps and reference them from a single sitemap index file (sitemap_index.xml). Large stores benefit from splitting by type—products, collections, blog—so you can diagnose indexing issues per section instead of guessing across one giant file. Keep <lastmod> dates accurate; faked dates erode trust.

The most common mistakes I see on audits: leaving old URLs in after a migration, listing pages that 404, mixing http and https or www and non-www versions, and dumping every parameter URL a plugin generates. In Yoast or Rank Math, disable sitemaps for taxonomies and post types you don't want indexed rather than letting the plugin include everything by default.

Once your sitemap is clean, submit it in Google Search Console under Sitemaps, then watch the Pages report. Compare 'Discovered' and 'Indexed' counts against your submitted URL count—a large gap points to quality or duplication issues, not a sitemap bug. Re-check after any migration, redesign, or bulk product change. A tight sitemap won't rank you alone, but a messy one quietly caps how much of your site Google bothers to index.

Frequently asked

Should I include noindex pages in my XML sitemap?

No. A sitemap says 'please index this,' while noindex says 'don't'—including both sends a contradictory signal. List only pages you want in search results.

How many URLs can one XML sitemap hold?

A single sitemap file is capped at 50,000 URLs and 50MB uncompressed. For larger sites, split into multiple files and link them from one sitemap index file.

Do I need an XML sitemap on Shopify if it's auto-generated?

You already have one at /sitemap.xml, so you don't create it manually. Your job is to control which pages appear by managing noindex settings and confirming exclusions in Search Console.

Should product filter and sort URLs go in the sitemap?

No. Parameter-based filter and sort URLs are usually duplicates or thin variants—exclude them and let canonical tags point to the main category page.

Free, concrete, yours to keep

Want this done for you — properly?

Get a free audit of your rankings and AI-answer presence. Real findings within days, no sales deck.

Get a free audit