Skip to content

fix(sitemap): stop stamping every URL with a made-up lastmod - #16

Merged
pedrobernardina merged 1 commit into
main-altfrom
fix/sitemap-drop-made-up-lastmod
Sep 25, 2026
Merged

pedrobernardina merged 1 commit into
main-altfrom
fix/sitemap-drop-made-up-lastmod

Conversation

@pedrobernardina

Copy link
Copy Markdown

What

  • website/handlers/sitemap.ts (the deco sitemap) no longer writes <lastmod>. It used today's date on every URL.
  • vtex/handlers/sitemap.ts gets an opt-in removeUrlLastmod prop. When it is on, the prop drops the <lastmod> of every <url> in the proxied VTEX sitemaps and leaves the <sitemap> blocks of the index alone. It is wired through vtex/loaders/proxy.ts, next to removeEntriesWithoutPage.

Why

On oficina.com, deco.xml (330 URLs) and category-0 (31) were all dated today, and product-0 (955) was all dated the day before. None of those dates says when a page changed. Google only trusts lastmod when it is consistently accurate and learns that per site, so these dates also undermine the real dates in the blog sitemaps. An absent <lastmod> is neutral.

Companion to deco-sites/oficina-reserva#806, which fixes the blog sitemaps' dates.

Test plan

Locally, with oficina-reserva's apps/ pointed at this branch:

removeUrlLastmod: true prop off
/sitemap.xml (index) 6 <sitemap>, lastmod kept —
/sitemap/deco.xml 330 URLs, 0 lastmod 0 lastmod (unconditional)
/sitemap/category-0.xml 31 URLs, 0 lastmod 31 lastmod
/sitemap/product-0.xml 955 URLs, 0 lastmod —
/sitemap/the-post-categories.xml 4 URLs, 4 lastmod (site handler, untouched) —

The deco sitemap wrote today's date on every <url>, and the VTEX sitemaps
come stamped with their generation date. Neither says when a page
changed, and crawlers that notice ignore lastmod for the whole site,
including sitemaps that carry real dates.

- website/handlers/sitemap.ts: no longer writes <lastmod>.
- vtex/handlers/sitemap.ts: new opt-in removeUrlLastmod prop drops the
  <lastmod> of every <url> in the proxied sitemaps, leaving the
  <sitemap> blocks of the index alone. Wired through vtex/loaders/proxy.ts.
@pedrobernardina
pedrobernardina merged commit 9f3d534 into main-alt Sep 25, 2026
4 checks passed
@pedrobernardina
pedrobernardina deleted the fix/sitemap-drop-made-up-lastmod branch September 25, 2026 11:00
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant