Skip to content

fix: remove changefreq/priority and fix lastmod per Google/Bing guidelines#46

Merged
ruibaby merged 1 commit intohalo-dev:mainfrom
ruibaby:fix/seo-fields-alignment
Apr 27, 2026
Merged

fix: remove changefreq/priority and fix lastmod per Google/Bing guidelines#46
ruibaby merged 1 commit intohalo-dev:mainfrom
ruibaby:fix/seo-fields-alignment

Conversation

@ruibaby
Copy link
Copy Markdown
Member

@ruibaby ruibaby commented Apr 27, 2026

Summary

  • Google explicitly documents that changefreq and priority are ignored (Build a Sitemap · Google Search Central)
  • Bing states the same in their Webmaster Blog (Feb 2023): "Bing largely disregards these fields"
  • Bing also warns: if lastmod is consistently set to the generation time rather than real modification date, they will distrust and discard it site-wide — which is exactly what the previous Instant.now() fallback caused for categories/tags/archives

Changes

  • Delete ChangeFreqEnum.java (no longer referenced anywhere)
  • Remove changefreq and priority fields from SitemapEntry
  • Remove corresponding output logic from SitemapBuilder.normalizeSitemapEntry()
  • Strip unused fields from SitemapGeneratorOptions: allowEmptySitemap, allowMultipleSitemaps, sitemapSize, autoValidate, gzip, generateIndexSitemap, fileNamePrefix, autoLastmod
  • transform() now produces only <loc>; proper <lastmod> support per content type will follow in a subsequent PR
  • Update SitemapBuilderTest and SitemapGeneratorOptionsTest accordingly

Test plan

  • SitemapBuilderTest — generated XML contains only <loc> and <lastmod> (when present); no <changefreq> or <priority> tags
  • SitemapGeneratorOptionsTesttransform() produces correct loc and null lastmod
  • Verify generated /sitemap.xml is valid XML and passes sitemap validators

Made with Cursor

移除 `changefreq` 和 `priority` 字段,常见搜索引擎已不列为参考指标

@f2c-ci-robot f2c-ci-robot Bot added the do-not-merge/release-note-label-needed Indicates that a PR should not merge because it's missing one of the release note labels. label Apr 27, 2026
@f2c-ci-robot
Copy link
Copy Markdown

f2c-ci-robot Bot commented Apr 27, 2026

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by:
Once this PR has been reviewed and has the lgtm label, please assign guqing for approval. For more information see the Code Review Process.

The full list of commands accepted by this bot can be found here.

Details Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@f2c-ci-robot f2c-ci-robot Bot added needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. and removed needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. labels Apr 27, 2026
…lines

Google and Bing both ignore changefreq and priority fields in sitemaps.
Remove these fields from SitemapEntry, SitemapGeneratorOptions, and
SitemapBuilder to avoid generating misleading metadata.

Also remove the Instant.now() fallback for lastmod in transform(): only
set lastmod when UrlEntryMeta actually carries a real modification time,
preventing inaccurate timestamps that could mislead crawlers.

Made-with: Cursor
@ruibaby ruibaby force-pushed the fix/seo-fields-alignment branch from 45cd729 to 4444565 Compare April 27, 2026 08:52
@f2c-ci-robot f2c-ci-robot Bot added release-note-none Denotes a PR that doesn't merit a release note. and removed do-not-merge/release-note-label-needed Indicates that a PR should not merge because it's missing one of the release note labels. labels Apr 27, 2026
@ruibaby ruibaby merged commit 74b3475 into halo-dev:main Apr 27, 2026
1 of 2 checks passed
@f2c-ci-robot f2c-ci-robot Bot added release-note Denotes a PR that will be considered when it comes time to generate release notes. and removed release-note-none Denotes a PR that doesn't merit a release note. labels Apr 27, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

release-note Denotes a PR that will be considered when it comes time to generate release notes.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant