Skip to content

What to put in sitemap.xml

What Google says a sitemap should contain, which fields it ignores, how lastmod should be used, and what this site's sitemap includes and gets wrong.

· Updated · 4 min read

A sitemap.xml fragment with a url, a lastmod date and an image entry

A sitemap lists the URLs you want Google to find. Put in canonical, indexable pages with full URLs, and add a lastmod date only if it is accurate. Google says it ignores the priority and changefreq fields. A sitemap is a hint, and it does not guarantee that anything is crawled or indexed.

This post follows two Google documents: the overview of sitemaps and the guide to building one. Then it compares them with this site's own sitemap.xml.

Do you need one#

Google does not say a sitemap is required. It says you might not need one if your site is small or well linked. It helps most when a site is large, when a new site has few links pointing to it, and when you have rich media or news content that Google can use extra information about. Even then, the overview says a sitemap does not guarantee that all the items will be crawled and indexed.

The rules#

  • Formats. XML, RSS, mRSS, Atom 1.0 and plain text are all supported, and Google has no preference.
  • Limits. One sitemap holds at most 50 MB uncompressed or 50,000 URLs. Larger sites must split it into several sitemaps, optionally listed in a sitemap index file.
  • Encoding. UTF-8, with tag values entity escaped.
  • URLs. Fully qualified and absolute. Include only the URLs you want to appear in search results, preferably the canonical ones.
  • Location. Anywhere on the site, but without a Search Console submission a sitemap affects only the descendants of its parent directory, so the site root is the safe place.
  • Text sitemaps. One URL per line, and nothing else in the file.
  • Submission. It is only a hint. You can use the Sitemaps report in Search Console, the API, or a Sitemap: line in robots.txt, which you can repeat.

lastmod, priority and changefreq#

Google says it uses the lastmod value if it is consistently and verifiably accurate. Updates to the main content, structured data or links generally count. Changing a copyright date does not.

Of the other two, the build guide is direct: "Google ignores <priority> and <changefreq> values." You can leave them out.

Extensions#

An XML sitemap can carry extra data through Google's sitemap extensions, which cover images, video, news and localized versions of a page. RSS and mRSS can describe video but not images or news.

What this site's sitemap contains#

The sitemap is generated at build time from the same content as the pages. It has:

  • the home page, the Apps page, the accessibility statement and the topic pages;
  • every Lab example, with its poster image;
  • every blog post, with lastmod and its cover as an image entry, plus the blog list;
  • tag pages, only when a tag has at least two posts, because a tag page with one post is marked noindex and so stays out of the sitemap too;
  • the tools and their category pages, where a category with one tool is also noindex and left out;
  • alternates for pages that exist in English and Ukrainian, as I describe in hreflang for a two-language site.

The robots.txt file points to it with a Sitemap: line, as Google allows. Pages that are blocked or noindex are not in the file, which keeps it consistent with what I want indexed.

Where it falls short#

  • It sets priority and changefreq. Every entry carries them, and Google says it ignores both. They do no harm, and they are noise I could drop.
  • lastmod is only as good as a manual field. For a blog post it comes from the updated date in the post's front matter, or from the publish date if there is none. That is accurate when I remember to update the field after an edit, and wrong when I forget. Tool pages use a manual updated date in the same way. Google's condition is that the value must be consistently and verifiably accurate, so a date I can forget to change is a weak spot. Writing this post also showed me a bug: the blog list and the tag pages took their date from the newest post by publish date, so editing an older post did not move it. They now take the latest date among their posts.
  • Many entries have no lastmod. The home page, Apps, the accessibility page, the topic pages and the Lab examples have none. That is acceptable, because an absent value is better than a wrong one.
  • Image entries point to WebP covers. Google Images supports WebP, so this should be fine, but I did not read the image sitemap guidelines for this post.

A checklist#

  1. Include only canonical, indexable URLs, with full https addresses.
  2. Leave out anything noindex, redirected or blocked.
  3. Add lastmod only if you can keep it true.
  4. Skip priority and changefreq.
  5. Reference the file in robots.txt and, if you use it, submit it in Search Console.
  6. Check that every URL returns a 200.

Limits of this post#

I read Google's two pages on 18 October 2026. I did not open the Sitemaps report in Search Console for this site, so I do not know how Google processes this file. The overview page says nothing about lastmod accuracy, and the statement comes from the guide to building a sitemap. The free tools on this site are in the sitemap like any other page.