XML Sitemap

An XML sitemap is a machine-readable list of the pages on your site that you want search engines to know about. It usually lives at /sitemap.xml, and each entry can carry the date that page last changed.

Which URLs belong in an XML sitemap

It should only list pages you want to appear in search results. Each one should load normally, be the canonical version of itself, and be open to indexing.

That rules out a few entries that often sneak in. A URL that redirects should be swapped for the page it redirects to. A page marked noindex, such as a basket or a thank-you page, shouldn't be listed at all. Broken pages and duplicates come out too. A clean list gives search engines a clear picture of what matters on your site.

Lastmod dates and sitemap index files

The <lastmod> date tells search engines when a page last changed. Google says it uses the date when it's consistently accurate, so it's worth updating it only when the content really changes. Changing every date every day, with nothing new on the pages, can lead search engines to ignore the dates altogether.

Large sites often split their sitemap into several files, listed in a sitemap index. A shop might keep products, categories, and guides in separate files, which also makes problems easier to spot in Search Console.

How the XML sitemap on our new site is built

Our new website writes its XML sitemap from its own list of pages each time it's published.

  1. Our site settings
    export const NOINDEX_PATHS = [MEET_PATH];export const isNoindexed = (path = "") => NOINDEX_PATHS.some((pattern) => pattern.test(path));
    One list of pages to keep out

    The pages we want kept out of search are named in one place. For now that's only the meeting booking pages under our contact page, which are kept out of search on purpose.

  2. Our sitemap.xml
    // Pages designated noindex (NOINDEX_PATHS) stay out. lastmod is the date the page's own// content last changed, the same date as its "Last updated" line (docs/page-dates.md).const urls=Object.keys(pages).map(id=>pageUrl(id,getMarket())).filter(Boolean).filter(url=>!isNoindexed(new URL(url).pathname));
    Everything else goes in, with its real date

    Every other page goes into the sitemap. Its lastmod is the date that page's own content last changed, which is the same date as the Last updated line at the foot of the page.

What an XML sitemap won't do

Submitting a sitemap helps search engines discover your pages. It doesn't guarantee they'll be crawled, indexed, or ranked. Pages still need internal links from the rest of the site, as a page that only appears in the sitemap can look unimportant. Once you submit a sitemap in Search Console, it reports how many of the listed URLs are indexed, and why the others aren't.

More technical SEO glossary terms

These technical SEO glossary terms cover crawling, indexing, redirects, sitemaps, structured data and page speed. Each definition shows the idea in a diagram and gives a practical example, so developers, marketers and site owners can talk about the same fix in the same words.