Google cannot rank a page it has not found. On a growing site, new posts, product pages and landing pages can sit undiscovered for weeks if your internal links do not reach them cleanly. That delay costs you traffic while competitors get indexed first. An XML sitemap fixes this by handing search engines a tidy list of every URL you want crawled. This guide walks you through what an XML sitemap is, what it looks like, and how to create, validate and submit one the right way.
What is an XML sitemap?
An XML sitemap is a file, usually named sitemap.xml, that lists the URLs on your site you want search engines to discover, crawl and index. It is written for crawlers, not visitors, and acts like a table of contents that points Google straight to your important pages.
The file is technically optional. Search engines can still find your pages through internal links and backlinks. But a sitemap gives them a direct, complete view of your URLs, which improves crawl efficiency and indexing coverage, especially on larger or newer sites.
You will see the format defined in the official sitemap protocol, which every major search engine supports. Sitemaps are one of the foundational pieces of technical SEO, sitting alongside your robots.txt file and site structure.
What does an XML sitemap look like?
An XML sitemap is a plain text file written in Extensible Markup Language (XML), a structured format that search engines read easily. It is also readable enough for humans to follow. Each page you want crawled sits inside its own entry.
Here is a basic sitemap with two URLs:
https://www.example.com/
2026-07-14
https://www.example.com/about/
2026-06-30
Every tag has a job. Some are required, and some are optional hints. The table below breaks down the ones you will meet most often.
Tag | Required? | What it does |
<urlset> | Yes | Wraps the whole sitemap and declares the protocol namespace. |
<url> | Yes | Holds one URL entry. Each page you want indexed gets its own <url> block. |
<loc> | Yes | The full, canonical URL of the page, including https://. This is the only required child tag. |
<lastmod> | Optional | The date the page was last meaningfully updated, in YYYY-MM-DD format. |
<changefreq> | Optional | A hint at how often the page changes: always, hourly, daily, weekly, monthly, yearly or never. |
<priority> | Optional | The relative importance of the page on a 0.0 to 1.0 scale. |
The required elements
Three tags do the real work, and a valid sitemap cannot go without them.
- <urlset> is the root element. It wraps every URL and includes the namespace, which tells search engines which version of the protocol the file follows.
- <url> is the container for a single page. Every page you want indexed sits in its own <url> block.
- <loc> is short for location. It holds the full canonical URL, written out in full with the protocol (https://). This is the only child tag search engines strictly need.
The optional tags (and which ones Google actually uses)
The protocol also supports three optional tags. They sound useful, but most of them carry little weight in practice, and it helps to know which is which before you spend time on them.
<lastmod>
This tag records the date a page was last meaningfully changed, in YYYY-MM-DD format. Of the three optional tags, it is the one worth getting right. Google confirms in its build and submit a sitemap guidance that it uses the lastmod value when it is consistently and verifiably accurate. If you set every page’s lastmod to today whenever you regenerate the file, Google learns your dates are unreliable and stops trusting them.
<priority>
Priority signals how important a page is relative to others on your site, from 0.0 to 1.0. Google ignores it. The sitemaps.org FAQ also states plainly that priority does not affect how your pages rank. Other search engines might read it, so it does no harm, but it is not worth fine-tuning.
<changefreq>
Change frequency hints at how often a page updates, using values like daily, weekly or monthly. Google ignores this one too, and it is best treated as decorative. If your sitemap generator adds it automatically, you can leave it. If you are building a sitemap by hand, you can skip it.
What is an XML sitemap index?
A sitemap index is a file that lists other sitemap files rather than individual pages. Think of it as a sitemap of your sitemaps. You need one when your site outgrows a single sitemap, or when you want to split sitemaps by content type such as posts, products and categories.
It uses <sitemapindex> and <sitemap> tags instead of <urlset> and <url>. Here is what one looks like:
https://www.example.com/sitemap-pages.xml
2026-07-14
https://www.example.com/sitemap-products.xml
2026-07-14
The convention is to place it at /sitemap_index.xml. WordPress SEO plugins like Yoast and Rank Math default to this structure, so if you use one, your main sitemap is almost certainly an index already.
Sitemap size and file limits
A single sitemap file has two hard limits set by the protocol: no more than 50,000 URLs, and no larger than 50MB uncompressed. These caps stop your server from being overwhelmed by very large files.
If you cross either limit, split the sitemap into several files and tie them together with a sitemap index. A sitemap index can itself reference up to 50,000 sitemaps, so there is plenty of room to scale.
You can also compress a sitemap with gzip, which gives it a .gz extension and reduces transfer size. Compression only affects the file on the wire, though. The uncompressed file must still stay under 50MB.
XML sitemaps vs other sitemap formats
XML is the most common sitemap format, but it is not the only one. It helps to know the alternatives so you can pick the right tool, or recognise what your platform has already given you. The table below sums up the choices, and the sections after it go into more detail.
Format | Best for | Carries metadata? |
XML | Any site; the default recommendation | Yes, including lastmod and extensions |
RSS / mRSS / Atom | Frequently updated blogs, podcasts, news | Recent changes only |
Text | Tiny, rarely changing sites | No, URLs only |
HTML | Human visitors, not search engines | No, it is a navigation page |
XML sitemaps
XML is the default recommendation for most sites. It works at any size, supports optional metadata like lastmod, and can be extended for images, video and news. Every major search engine reads it, which makes it the most versatile and comprehensive option.
RSS, mRSS and Atom feeds
These feeds describe only your most recent changes rather than every URL. That makes them a natural fit for frequently updated blogs, podcasts and news sites, and mRSS in particular can help with video discovery. They work best as a complement to a full XML sitemap, not a replacement.
Text sitemaps
A text sitemap is the simplest format: a plain list of URLs, one per line, with no metadata. It is fine for a tiny, rarely changing site, but it cannot carry lastmod dates or media information, so most sites will outgrow it quickly.
XML sitemap vs HTML sitemap
These two get confused because they share a name, but they serve different audiences. An XML sitemap is built for search engines and helps with crawling and indexing. An HTML sitemap is a page built for human visitors, listing your content in a clear hierarchy to aid navigation. An HTML sitemap can support SEO indirectly through better user experience, but it does not replace the XML version.
Sitemap extensions for media and news
A standard sitemap lists page URLs, but you can extend it to describe specific content types. You only need these when the content type matters for discovery, so most sites can skip them.
Image sitemaps
An image sitemap gives search engines extra detail about images on your pages, helping them surface in image search. You can list up to 1,000 images per page, which makes this useful for ecommerce catalogues, portfolios and galleries where images drive discovery.
Video sitemaps
A video sitemap describes video content so it can appear in video results. Google’s video sitemap guidelines require details like a title, description, thumbnail URL and the raw video or player URL for each entry. Make sure your robots.txt file does not block any of those assets, or the entries get ignored.
News sitemaps
A news sitemap is for content eligible for Google News. It should list only articles from the last two days, cap out at 1,000 URLs, and be updated in place as you publish rather than rebuilt each time. This one is strictly for approved news publishers.
Hreflang / multilingual sitemaps
If you run a site across several languages or regions, you can declare those variants in the sitemap using hreflang annotations instead of adding them to every page. This keeps things manageable when you have many locale variations to maintain.
Why XML sitemaps matter for SEO
A sitemap will not lift your rankings on its own, and it is not a substitute for solid internal linking. What it does is make crawling and indexing more efficient, which is the groundwork everything else sits on. Here is where that pays off, and it is worth building into your wider SEO strategy.
Faster, more complete crawling
By listing your important URLs in one place, you give crawlers a direct route to every page you care about. This matters most on large sites or ones with deep, complex navigation, where some pages sit many clicks from the homepage.
Quicker indexing of new and updated content
When you publish or update a page, including it in your sitemap helps search engines find it sooner. That speed helps most for sites that add content often, such as blogs and ecommerce stores with changing stock.
Discovery of orphan pages
Orphan pages have no internal links pointing to them, so crawlers that follow links can miss them entirely. Listing these pages in your sitemap gives them a way to be found. The better fix is to add internal links too, but the sitemap is a useful safety net.
Richer metadata signals (lastmod)
An accurate lastmod date tells search engines when a page genuinely changed, which helps them decide when to recrawl it. Kept honest, it is a small but real signal in your favour.
Indexing insight through Search Console
Once you submit a sitemap, Google Search Console shows how many of its URLs are submitted versus actually indexed. A large gap between the two is a useful diagnostic, often pointing to crawl or quality issues worth investigating.
Do XML sitemaps matter for AI search?
Yes, but indirectly. AI answer surfaces like Google’s AI Overviews still draw on the traditional search index, so your pages usually need to be crawled and indexed before they can appear in an AI-generated answer.
This is where a sitemap earns its keep. By listing your URLs clearly and keeping lastmod accurate, you make it easier for search engines to discover and refresh your content, which is a prerequisite for showing up anywhere, AI results included. A sitemap will not win you an AI citation by itself, but it is part of the discoverability groundwork that AI SEO builds on.
Which pages should you include in an XML sitemap?
The rule is simple: include only indexable, canonical pages that return a 200 status and that you want in search results. Leave everything else out. This matters as much for a small local SEO site as it does for a large one, because a clean sitemap sends a clearer signal.
Pages to include
Include the pages that add value for someone arriving from search:
- Your homepage
- Key landing and service pages
- Blog posts and articles
- Product pages
- Product category pages
Pages to leave out
Leave out pages that should not appear in search results, or that add no value to a searcher:
- Admin and login pages
- Thank-you and confirmation pages
- Internal search results pages
- Redirects and 404 error pages
- Non-canonical or parameter duplicate URLs
- Thin tag or category archives with little content
- Anything you have tagged noindex
One caveat: leaving a URL out of the sitemap does not stop Google indexing it if the page is linked elsewhere. If you truly want a page kept out of search, use a noindex tag rather than relying on the sitemap alone.
How to create an XML sitemap
For most sites, you should automate this. Manual creation only makes sense for a small, static site with a handful of stable URLs. Work through the options below in order.
Check whether you already have one
Before you build anything, check what you already have. Visit yourdomain.com/sitemap.xml, and if that returns nothing, try /sitemap_index.xml. Many platforms generate a sitemap by default, so you may find the job is already done.
Create it automatically with your CMS or a plugin
Most content management systems either generate a sitemap out of the box or offer a plugin that does. Here is how the common platforms handle it.
WordPress
WordPress has generated a basic sitemap in core since version 5.5, released in 2020, at /wp-sitemap.xml. It works, but it offers little control. For more say over what is included, an SEO plugin replaces it with a fuller sitemap index at /sitemap_index.xml. The two most common are:
- Yoast SEO, which generates and updates a sitemap automatically and excludes noindex pages for you.
- Rank Math, which offers similar automatic sitemap generation with granular control over content types.
Shopify
Shopify generates and updates an XML sitemap automatically at yourstore.com/sitemap.xml, with child sitemaps for products, collections, blogs and pages. There is nothing to install, and it updates whenever you add or remove content. If you run a store, our guide to Shopify SEO covers how this fits the bigger picture.
Wix
Wix creates and updates your sitemap automatically at yourdomain.com/sitemap.xml, and it can submit the file to Google on your behalf once your site is connected. Content changes are reflected without any manual step.
Squarespace
Squarespace generates a sitemap by default at yourdomain.com/sitemap.xml and updates it automatically as you add, edit or remove pages. Control is limited, but for most Squarespace sites the default is enough.
Webflow
Webflow auto-generates a sitemap at yourdomain.com/sitemap.xml each time you publish, on a paid plan. Its help documentation notes that Webflow also adds the sitemap to your robots.txt automatically, and includes hreflang tags when you have Localize enabled.
Drupal
Drupal does not generate a sitemap in core. You add the Simple XML Sitemap module (or the older XML Sitemap module), choose which content types to include, and it then keeps the file at /sitemap.xml updated as content changes.
Joomla
Joomla also needs an extension. Installing one such as OSMap lets you pick which content and menu items to include, after which it maintains the sitemap for you.
Create it with a standalone generator tool
If your platform does not generate a sitemap, or you need more control than it offers, a crawl-based generator tool can build one for you. These crawl your site, find the indexable URLs and export an XML file you can upload or submit. When choosing one, check how it handles your site’s size, whether it updates automatically or produces a one-off file, and whether it can exclude noindex pages and validate the output.
Create it manually
Hand-coding a sitemap only makes sense for a small site with a few dozen stable URLs. If that is you, the steps are:
- Create a text file and save it as sitemap.xml.
- Add the XML declaration and the <urlset> namespace from the protocol.
- List each canonical URL inside its own <url> and <loc> tags.
- Add <lastmod> only if you can keep the date accurate.
- Validate the XML syntax before you upload anything.
- Upload the file to your site’s root so it is reachable at yourdomain.com/sitemap.xml.
How to validate your XML sitemap
A valid sitemap must load at its URL, follow the protocol, and list only indexable, canonical URLs. Validating before you submit saves you from crawl errors later. An SEO audit will catch most of these automatically, but here are the issues to watch for and how to fix each one.
Sitemap not found at the expected URL
If the file does not load, crawlers cannot use it. Make sure sitemap.xml sits in your root directory and is publicly accessible.
XML formatting errors (unclosed tags, unescaped characters)
Invalid XML breaks the file. Close every tag correctly and escape special characters, for example using & in place of a raw ampersand.
File exceeds the 50MB / 50,000-URL limit
A file over either limit may be rejected or truncated. Split it into multiple sitemaps and reference them from a sitemap index.
Non-200 URLs (redirects or errors) included
Redirects and error pages waste crawl budget. Remove any URL that does not return a 200 status and regenerate the file with live pages only.
Non-canonical or parameter URLs included
Listing duplicate or parameter versions of a page muddies the signal. Include only the canonical version of each URL.
HTTP URLs on an HTTPS site
If your site runs on HTTPS, your sitemap should not list HTTP URLs. Regenerate it so every <loc> uses the secure protocol.
Sitemap not referenced in robots.txt
Crawlers look in robots.txt for a sitemap pointer. Add a line such as Sitemap: https://yourdomain.com/sitemap.xml so they can find it quickly.
Orphaned pages listed in the sitemap
A page in your sitemap with no internal links pointing to it sends a mixed signal. Either add internal links to it or remove it from the sitemap.
How to submit your XML sitemap to Google Search Console
Submitting your sitemap lets you monitor its status and catch errors. In Google Search Console, the steps are:
- Open Search Console and select your property.
- Click Sitemaps in the left-hand navigation.
- Enter your sitemap URL in the Add a new sitemap field.
- Click Submit, then check for a Success status once Google has processed it.
Google recrawls submitted sitemaps over time, so you only submit once. Resubmit the same URL after a major site change to prompt a fresh crawl. It is worth doing the same in Bing Webmaster Tools. Keep in mind that submitting a sitemap helps discovery but does not guarantee indexing.
XML sitemap best practices
Most of these follow naturally once your sitemap is automated, but they are worth a quick pass to make sure nothing is undermining it.
Keep it up to date
Your sitemap should mirror your live site. Remove pages from it when you delete them, and keep lastmod honest. If you outsource this, website maintenance usually keeps the sitemap current as part of the job.
Include only indexable, canonical pages
Every URL in the file should return a 200 status, be canonical, and be one you want in search. This is the single habit that keeps a sitemap clean.
Reference it in robots.txt
Add a Sitemap: line to your robots.txt file pointing at the sitemap URL. Even when the file sits at the standard location, this helps crawlers find it.
Stick to the default location and filename
Keep the sitemap at /sitemap.xml and the index at /sitemap_index.xml where you can. Standard locations are the easiest for search engines to find.
Don’t obsess over priority and changefreq
Since Google ignores both tags, there is no value in fine-tuning them. Spend that effort on accurate lastmod dates instead.
Stay within the size limits
Keep each file under 50,000 URLs and 50MB. Once you approach either limit, move to a sitemap index rather than letting a single file grow unchecked.
Frequently Asked Questions
An XML sitemap is a file, usually sitemap.xml, that lists the URLs on your site you want search engines to discover and crawl. It helps them understand your site structure and find your important pages efficiently.
It is a plain XML file where each page sits in a <url> block containing a <loc> tag with the page's full URL. Optional tags like <lastmod> can be added to show when a page last changed.
In most cases it sits in your site's root directory at yourdomain.com/sitemap.xml. Some platforms use a different default, such as /wp-sitemap.xml on WordPress or /sitemap_index.xml when an SEO plugin is active.
The easiest way is to let your CMS or an SEO plugin generate it automatically. If your platform does not, a crawl-based generator tool can build one, or you can hand-code a small sitemap yourself.
Open Google Search Console, select your property, go to Sitemaps, enter your sitemap URL and click Submit. You only need to do this once, though you can resubmit after major changes.
Usually not. If your sitemap is generated by your CMS or an SEO plugin, it updates automatically as your URLs change. Manual updates are only needed for hand-coded sitemaps.
You do not need to. Google ignores both tags, so fine-tuning them adds no SEO value. If your generator includes them by default, it is harmless to leave them in.
An XML sitemap is built for search engines and supports crawling and indexing. An HTML sitemap is a page built for human visitors to help them navigate. They serve different jobs, and a site can use both.
Add /sitemap.xml to your domain and see if a file loads. If nothing appears, try /sitemap_index.xml. If a site runs an SEO plugin like Yoast, the first URL often redirects to the second.
Bringing it together
An XML sitemap is one of the simplest wins in technical SEO. Get it right and you help search engines find, crawl and index every page you care about, which gives your content its best chance to rank and to show up in AI-generated answers. Set yours up, keep it clean, submit it once, and let it work quietly in the background.
If you would like a hand auditing your sitemap or your wider setup, our SEO services team is happy to take a look.




