What an XML sitemap looks like
An XML sitemap is a file made for search engines, not for visitors. It usually lives at /sitemap.xml. A minimal one with two pages looks like this:
<?xml version="1.0" encoding="UTF-8"?>
<urlset xmlns="http://www.sitemaps.org/schemas/sitemap/0.9">
<url>
<loc>https://www.example.com/</loc>
<lastmod>2026-09-14</lastmod>
</url>
<url>
<loc>https://www.example.com/repot-a-houseplant</loc>
<lastmod>2026-08-02</lastmod>
</url>
</urlset>
That is the whole format. The first line says the file is XML. The urlset element wraps the list, and its xmlns value tells search engines which sitemap standard the file follows. Each url block holds one page. Most site builders, including WordPress, Shopify, Wix and Squarespace, create and update this file for you.
What each tag means
locis the full address of the page, starting withhttps://. It must be the exact address you want in search results, on the same domain as the sitemap.lastmodis the date the page last changed in a meaningful way, written as year, month and day. Google uses it when it is accurate across the whole file. Setting every page to today's date teaches Google to ignore it.changefreqandpriorityare optional tags you will still see in many sitemaps. Google ignores both, so there is no point in tuning them.
Special characters in an address must be written in XML form. An ampersand, for example, becomes &. A sitemap generator handles this for you.
The sitemap.xml format comes down to four rules:
- The file is plain XML in UTF-8, usually saved as
sitemap.xmlat the root of the site. - Everything sits inside one
urlset, with oneurlblock per page. - Each
locis a full address, includinghttps://. - One file holds up to 50,000 addresses or 50 MB. Bigger sites use a sitemap index, shown below.
To make one from a list of addresses, use the free XML sitemap generator. It writes a valid file you can copy or download.
A larger example: the sitemap index
One sitemap file may list up to 50,000 addresses and be up to 50 MB before compression. Bigger sites split their pages into several sitemaps and list those files in a sitemap index:
<?xml version="1.0" encoding="UTF-8"?>
<sitemapindex xmlns="http://www.sitemaps.org/schemas/sitemap/0.9">
<sitemap>
<loc>https://www.example.com/sitemap-pages.xml</loc>
</sitemap>
<sitemap>
<loc>https://www.example.com/sitemap-products.xml</loc>
</sitemap>
</sitemapindex>
Splitting by type, such as pages, posts and products, also makes the Search Console report easier to read, because problems show up per file.
Why it matters
- It helps pages get found. Crawling starts with knowing that an address exists. A sitemap is most useful for new sites, large sites and pages with few links pointing to them.
- It is a list of suggestions, not a promise. Being in the sitemap does not guarantee indexing. Google still decides whether each page is worth showing.
- It does not replace links. An internal link tells a search engine that a page exists and that it matters to you. A page that appears only in the sitemap looks less important than one your other pages link to.
- It shows you problems. The Sitemaps report in Search Console tells you how many of the listed pages are indexed, which makes gaps easy to spot.
What to leave out
A sitemap should list only pages you want to appear in search results. Leave out:
- addresses that redirect somewhere else
- pages that return an error, such as 404 not found
- pages marked noindex
- duplicate versions of a page, where a canonical tag points to another address
- pages blocked in robots.txt
XML sitemap or HTML sitemap?
An HTML sitemap is an ordinary page with a list of links, written for people. An XML sitemap is a file written for search engines. They do different jobs: the HTML version can help visitors and spread internal links on a large site, and the XML version tells search engines what to crawl. Most small sites need only the XML file.
How to check and submit yours
- Type your domain followed by
/sitemap.xmlinto your browser. If nothing loads, look for aSitemap:line in your robots.txt file, or try/sitemap_index.xml, which WordPress plugins often use. - Skim the list. Are your important pages there, and are pages you would not want in Google missing?
- Open a few of the addresses. Each should load directly, without a redirect or an error. The checker on the XML sitemap tool does this for you: it reads the file and flags addresses that redirect, return errors or are marked noindex.
- In Google Search Console, open Sitemaps, paste the sitemap address and press Submit. Do the same in Bing Webmaster Tools.
- Come back after a few days and read the report. A large gap between submitted and indexed pages is worth investigating page by page.
The lesson XML sitemaps: what to include and what to leave out goes through each choice in more detail.