Skip to content

seo: make sitemap lastmod reflect real modification dates - #361

Merged
xgp merged 1 commit into
mainfrom
seo/accurate-lastmod
Sep 1, 2026
Merged

seo: make sitemap lastmod reflect real modification dates#361
xgp merged 1 commit into
mainfrom
seo/accurate-lastmod

Conversation

@xgp

@xgp xgp commented Sep 1, 2026

Copy link
Copy Markdown
Member

Every URL in the live sitemap currently carries <lastmod>2026-09-01</lastmod> — the build date — including a blog post from July and static hosting pages.

That's worse than having no lastmod. It was added to tell crawlers what actually changed; a field that says "everything changed today" on every crawl teaches them to ignore it.

Two causes, both needed

  1. showLastUpdateTime was only on the tutorials plugin. Docs and blog exposed no modification date, so the sitemap fell back to build time.
  2. The deploy workflow checks out at the default depth of 1. Docusaurus derives the date from git history — in a shallow clone every file looks like it changed in the single fetched commit, so the flag alone wouldn't have helped.

Effect

Locally, the sitemap goes from 1 distinct lastmod value to 46:

Page Before After
/docs/organizations/scim/ 2026-09-01 2026-06-01
/blog/scaling-keycloak-event-storage/ 2026-09-01 2026-08-31
/tutorials/getting-started/run-keycloak-locally/ 2026-09-01 2026-09-01 ✓

The blog post shows 2026-08-31 rather than its July publication date because that's when the file was genuinely last edited — the author byline change. That's correct: lastmod is about modification, not publication.

Heads up: this is a visible change too

showLastUpdateTime renders a "Last updated" line on docs and blog pages. Reasonable as a freshness signal for readers, but worth a look before merging in case you'd rather not show it. It can be suppressed while keeping the sitemap benefit if preferred.

Verification

  • pnpm build passes
  • Sitemap: 346 URLs, 321 with lastmod, 46 distinct dates

Every URL in the live sitemap carried <lastmod>2026-09-01</lastmod> — the build
date — including a blog post from July and static hosting pages. A lastmod that
says "everything changed today" on every crawl carries no information, and a
crawler that learns to ignore it is worse off than one that never saw the field,
because it was added in the first place to tell Google what actually changed.

Two causes, both needed fixing:

- showLastUpdateTime was set only on the tutorials plugin, so docs and blog
  exposed no modification date and the sitemap fell back to build time.
- The deploy workflow checked out at the default depth of 1. Docusaurus derives
  the date from git, and in a shallow clone every file looks like it changed in
  the single fetched commit — so the flag alone would not have helped.

Locally this takes the sitemap from 1 distinct lastmod value to 46: docs pages
now date to when they were actually edited (/docs/organizations/scim to
2026-06-01), rather than all claiming today.

Note this also renders a visible "Last updated" line on docs and blog pages. That
is a reasonable freshness signal for readers, but it is a visible change, not
just metadata.
@cloudflare-workers-and-pages

Copy link
Copy Markdown

Deploying phasetwo-docs with  Cloudflare Pages  Cloudflare Pages

Latest commit: 44e4a60
Status: ✅  Deploy successful!
Preview URL: https://3545196f.phasetwo-docs.pages.dev
Branch Preview URL: https://seo-accurate-lastmod.phasetwo-docs.pages.dev

View logs

@xgp
xgp marked this pull request as ready for review September 1, 2026 19:33
@xgp
xgp merged commit 8681228 into main Sep 1, 2026
3 checks passed
@xgp
xgp deleted the seo/accurate-lastmod branch September 1, 2026 19:33
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