# What an XML sitemap is, when you need one, and which tags matter

> An XML sitemap is a file that lists the pages, videos and other files on a site so search engines like Google can crawl it more efficiently. Many sites need one, but not all. Google says a site of 500 pages or fewer whose pages are well linked, with little media or news content, may not. A sitemap helps discovery but doesn't promise that every listed URL will be crawled or indexed.

Canonical: https://heddle.pro/learn/xml-sitemap

---

How an engagement works.

## What it is

A sitemap is a file that tells search engines which pages and files on a site exist and how they relate. Google reads it to crawl the site more efficiently and to learn which pages matter, when a page was last updated, and whether it exists in other languages.

Variants carry extra detail. A video sitemap can include running time and ratings, an image sitemap shows where images sit on a page, and a news sitemap adds a headline and publication date.

A sitemap is a request to be found, not a promise. Google says it helps Google discover URLs but doesn't promise that every listed item will be crawled and indexed.

## Does your site need one

Google says that if a site's pages are properly linked, it can usually find most of the site without one. It names three cases where a sitemap helps. One is a large site, where it's hard to make sure every page is linked from at least one other page. Another is a new site with few links from other sites. The third is a site with a lot of video and images, or one that appears in Google News.

You may not need one if the site has 500 pages or fewer that you want in search results, and every important page can be reached by following links from the home page. The site should also have little media or news content to show in Search. Google adds that in most cases a site still benefits from having one. If the site runs on WordPress, Wix or Blogger, check first, because the CMS may already publish one.

## The format

The file opens with <urlset> and the protocol namespace, then has one <url> entry per page, each with a <loc> holding the full address. Those are the only required parts. Each <loc> must start with the protocol, such as https, and be less than 2,048 characters, and every URL in one file must come from a single host.

The file must be UTF-8. Ampersands, quotes and angle brackets inside values must be entity-escaped, so an & in a query string is written &amp;.

## The optional tags

<lastmod> is the one worth getting right. It must be the date the page itself last changed, in W3C Datetime format such as YYYY-MM-DD, not the date the sitemap was generated. A sitemap that stamps every URL with today's date tells crawlers nothing.

<changefreq> and <priority> carry less weight. The protocol calls changefreq a hint and not a command, so crawlers may visit an hourly page less often and a yearly page more often. Priority runs from 0.0 to 1.0 with a default of 0.5, only compares pages within your own site, and isn't likely to change where your pages rank. Setting every URL to high priority doesn't help. Support for all optional tags varies by search engine.

Figure: lastmod should be the day the page last changed. A sitemap that stamps every URL with today's date tells crawlers nothing.

```mermaid
%% caption: lastmod should be the day the page last changed. A sitemap that stamps every URL with today's date tells crawlers nothing.
flowchart LR
  subgraph True["Useful"]
    direction TB
    A[A page changes] --> B[lastmod: the day it changed]
  end
  subgraph Now["Useless"]
    direction TB
    C[Every URL] --> D[lastmod: the day the file was built]
  end
  True ~~~ Now
  class B accent
  class D muted
```

## What our sitemap missed in a move

When one of our own sites moved off its old builder, we diffed the old sitemap against the new build. On 10 August 2026 that found 22 URLs that would have 404'd on cutover, including nine service pages and three legal pages.

The sitemap wasn't the whole story. Five older paths that predated it 404'd for months, until a full crawl and Search Console found them on 19 September 2026. A sitemap is a floor for an inventory. Heddle adds Search Console's pages to it.

## Sources

- developers.google.com /search/docs/crawling-indexing/sitemaps/overview
- sitemaps.org /protocol.html
Each was read on October 11, 2026.

## Questions

### Does a sitemap get my pages indexed?

Not on its own. Google says a sitemap helps it discover URLs but doesn't promise that every item in it will be crawled and indexed.

### Do small sites need an XML sitemap?

Often not. Google says a site with 500 or fewer pages it wants in search, whose important pages are all linked from the home page, and with little media or news content, may not need one.

### Does the priority tag improve rankings?

No. The sitemap protocol says priority is relative to other pages on your own site and isn't likely to influence your position in search results.

### What should lastmod contain?

The date the linked page was last modified, in W3C Datetime format such as YYYY-MM-DD. The protocol says it mustn't be the date the sitemap was generated.

## Ready to get found? Check your site, talk to us, or see the plans.

Tell us about your business and who buys from you. On a short call we'll show you the searches your buyers make where you don't show up yet, and what the agents would do about them in their first month.
