When you build a website, you know exactly where everything lives. You know your homepage is at the root, your blog posts are nested under /blog/, your product pages are all in /shop/. It’s your house. You built it.
Google has never visited before. It’s showing up for the first time, with no blueprint, no map, no tour guide. It’s going to find your pages by wandering around and following links wherever they lead. Some pages will get found quickly. Others might take weeks. And some, particularly the ones buried deep with no internal links pointing toward them, might never get found at all.
An XML sitemap is the solution to that problem. It’s you handing Google a map and saying: “Here’s everything worth looking at. Don’t waste time hunting.”
What Exactly Is an XML Sitemap?
An XML sitemap is a file that lives on your website and lists the URLs you want search engines to discover and index. It’s written in a format called XML (Extensible Markup Language), which is just a structured way of organizing information that computers can read easily.
You don’t need to fully understand XML to work with sitemaps. The basic structure looks like this:
<?xml version=”1.0″ encoding=”UTF-8″?>
<urlset xmlns=”http://www.sitemaps.org/schemas/sitemap/0.9″>
<url>
<loc>https://www.yoursite.com/about/</loc>
<lastmod>2026-03-15</lastmod>
</url>
<url>
<loc>https://www.yoursite.com/blog/how-search-engines-work/</loc>
<lastmod>2026-04-01</lastmod>
</url>
</urlset>
Each URL on your site gets its own <url> entry. The <loc> tag holds the actual address. The <lastmod> tag tells search engines when that page was last meaningfully updated.
You might also see tags like <changefreq> and <priority> in some sitemaps. Worth knowing: Google has publicly stated it ignores both of these. Including them doesn’t hurt anything, but don’t waste time managing them carefully either Google isn’t reading them.
Your sitemap file is typically found at yourdomain.com/sitemap.xml, which is the first place search engines check when they’re looking for one.
XML Sitemap vs HTML Sitemap: Two Different Things
This trips people up constantly so let’s clear it up immediately.
XML Sitemap
An XML sitemap is built for search engines. It’s a file full of URLs in a structured format. Regular visitors never see it and don’t need to. Its entire job is to help bots discover your pages efficiently.
HTML Sitemap
An HTML sitemap is built for humans. It’s an actual page on your website, usually linked from your footer, that lays out your site structure in a way visitors can browse and navigate. Think of it as a table of contents page.
Both can exist on the same site. Both serve different purposes. When SEO people talk about “sitemaps” without specifying, they almost always mean the XML version.
Why Does a Sitemap Matter for SEO?
Here’s a question worth asking: if Google is smart enough to follow links across the entire internet, why does it need you to hand it a list of URLs?
Because following links has real limitations.
If a page has no internal links pointing to it, Google might never find it. If your site navigation buries certain pages three or four levels deep, Google might reach them infrequently or not at all. If you just published twenty new blog posts today, Google might not discover them for weeks while it works through its normal crawling schedule.
A sitemap solves all three problems at once. It’s a direct shortcut that tells Google your pages exist without requiring it to stumble across them through links.
A few situations where a sitemap is especially important:
Your site is new. A brand-new site has zero external links pointing to it and often limited internal linking too. A sitemap becomes the primary way search engines discover your content in those early weeks.
Your site is large. Sites with hundreds or thousands of pages really benefit from sitemaps because internal linking alone can’t reliably surface every page to crawlers. Ecommerce sites with large product catalogs are a classic example.
You publish content frequently. If you’re adding new blog posts regularly, a sitemap helps Google discover fresh content faster than waiting for it to be found through internal links.
Some pages are hard to reach through links. If you have important pages that aren’t well-connected to the rest of your site, a sitemap is sometimes the only realistic way to make sure Google knows they exist.
For a small, well-linked site with solid navigation, a sitemap is less critical but still a good idea. It costs you almost nothing and there’s genuinely no downside to having one.
What Goes Into a Sitemap (And What Shouldn’t)
This is where most beginner guides wave their hands and move on, but it’s actually where people make the most consequential mistakes.
Include only pages you want indexed. Your sitemap should be a curated list of pages you actually want to show up in Google, not a complete dump of every URL your site generates. Checkout pages, thank-you pages, internal search result pages, admin areas, duplicate parameter variations none of these belong in your sitemap.
Include only pages that return a 200 status code. If a page redirects to somewhere else, or returns a 404 error, it shouldn’t be in your sitemap. Including broken or redirected URLs signals carelessness to search engines and can slow down crawling as Google wastes time on dead ends.
Include only your canonical URLs. If you have multiple versions of a page (say, HTTP and HTTPS versions, or www and non-www versions), only the version you’ve designated as the “real” one should appear in your sitemap. Mixing canonical and non-canonical URLs in the same sitemap causes genuine confusion.
Don’t include noindex pages. If you’ve added a noindex tag to a page telling Google not to include it in search results, including that same page in your sitemap creates a contradiction. You’re simultaneously saying “please look at this” and “please don’t index this.” Google can handle the contradiction, but it’s sloppy practice and worth cleaning up.
Sitemap Limits Worth Knowing
A single sitemap file can contain a maximum of 50,000 URLs and must be under 50 MB in size when uncompressed. For most websites, these limits will never be an issue. For larger sites, the solution is to split content across multiple sitemap files and reference all of them in something called a sitemap index.
A sitemap index is simply a file that lists your other sitemaps rather than individual URLs. Many large sites use one sitemap for blog posts, a separate one for product pages, another for category pages, and so on. The sitemap index points to all of them, and you submit just the index file to Google.
Types of Sitemaps Beyond the Standard One
Most sites need only a standard page sitemap. But a few specific situations call for additional sitemap types.
- Image sitemaps help Google discover images that might not be easily found through standard crawling. They’re particularly useful for photography sites, ecommerce stores with large product photo libraries, or any site where image visibility in Google Image Search matters.
- Video sitemaps help Google understand and index video content, including details like thumbnail URLs, titles, and descriptions. If video is a significant part of your content, these are worth setting up.
- News sitemaps are specifically for publishers who want their articles considered for Google News. They have stricter requirements than standard sitemaps and only work if your publication is eligible for Google News in the first place.
How to Create Your Sitemap
The good news is you probably don’t need to build this manually.
If you’re on WordPress, you likely already have one. WordPress has included basic sitemap generation since version 5.5, accessible at yourdomain.com/wp-sitemap.xml. If you’re using an SEO plugin like Yoast SEO or Rank Math, those plugins replace WordPress’s default sitemap with a more configurable version that gives you better control over what’s included. In most cases, installing one of these plugins and enabling the sitemap feature is all you need to do.
If you’re on Shopify, it generates a sitemap automatically at yourdomain.com/sitemap.xml. It’s there by default, no setup required.
If you’re on Squarespace or Wix, both platforms generate sitemaps automatically too. Again, usually no action needed on your part.
If you’re on a custom-built site or a platform that doesn’t generate sitemaps automatically, you have two options: use an online sitemap generator tool (xml-sitemaps.com is a free option for smaller sites) or have a developer set up automatic generation that updates whenever you publish new content.
The automatic option is always better than a manually maintained one. A sitemap that goes stale because nobody updated it is almost worse than no sitemap at all, since it sends Google chasing URLs that may have changed or disappeared.
How to Submit Your Sitemap to Google
Creating a sitemap is step one. Telling Google about it is step two.
The straightforward way is through Google Search Console, which is Google’s free tool for monitoring how your site appears in search. Once your site is verified in Search Console, go to the Sitemaps section in the left navigation, enter your sitemap URL, and click Submit. Google will confirm receipt and show you the status of your sitemap over the following hours and days.
You should also add a reference to your sitemap in your robots.txt file, which lives at yourdomain.com/robots.txt. Adding a single line like this:
Sitemap: https://www.yoursite.com/sitemap.xml
…tells any crawler that visits your robots.txt file exactly where your sitemap lives, without requiring them to guess or wait for you to submit it somewhere. It’s a two-second addition that genuinely helps.
Common Sitemap Problems That Hurt SEO
A few things that seem minor but actually matter quite a bit:
Submitting a sitemap and then forgetting it exists. Sitemaps need to stay accurate as your site changes. If pages get deleted, moved, or given noindex tags, your sitemap should reflect that. An outdated sitemap full of dead links or contradictory instructions creates noise that slows down crawling.
Including every URL the site generates. Some platforms automatically dump every URL variant, every filter combination, and every parameter into the sitemap. For an ecommerce site, this can mean thousands of near-duplicate URLs clogging up your sitemap and eating into your crawl budget. Audit your sitemap periodically and make sure what’s in there is actually what you want indexed.
Blocking your sitemap in robots.txt. This sounds ridiculous but it happens. Usually during a site migration or when someone copies robots.txt settings from a staging environment to the live site without checking. If robots.txt blocks access to your sitemap file, Google can’t read it. If you’ve ever done a migration and noticed indexing suddenly dropped, this is one of the first things to check.
Having your sitemap URL mismatch your canonical domain. If your canonical domain is https://www.yoursite.com but your sitemap contains URLs that start with http://yoursite.com, that inconsistency creates confusion and can contribute to indexing problems over time.
A Quick Gut Check for Your Sitemap Right Now
If you want to verify your sitemap exists and looks reasonable, open a browser and type your domain followed by /sitemap.xml. If a structured list of URLs appears, you have one. If you get a 404 error or a blank page, you don’t, and that’s worth fixing.
From there, glance through the URLs listed. Do they look like real, useful pages you’d want appearing in Google? Are any obviously wrong (old pages that were deleted, parameter-heavy filter URLs, admin pages)? That five-minute check will tell you a lot about the state of your sitemap and whether it needs attention.
The Bottom Line
An XML sitemap is one of the simplest and most underrated technical SEO tasks you can get right. It doesn’t take long to set up correctly, the ongoing maintenance is minimal once you have automatic generation working, and the downside of not having one, especially on a new or growing site, is real and measurable.
Think of it as basic courtesy to the search engines trying to do their job on your site. You’ve built something. A sitemap helps them find all of it.