Skip to content

[P2] Audit: Hreflang and canonical consistency needs automated validation #146

Description

@baixiangcpp

Imported from the byteflow.tools deep audit on 2026-06-22.

Problem: the site supports multiple locales. Manual checks showed locale pages are reachable, but hreflang and canonical consistency should be automatically validated across all locales and page types.

Affected locales:

  • en, zh-CN, zh-TW, ja, ko, de, fr

Affected page types:

  • Home pages
  • Category pages
  • Tool pages
  • Workflow pages
  • Cluster/tutorial pages
  • Legal and PWA pages

Reproduction steps:

  1. Select representative URLs in each locale.
  2. Inspect canonical tags.
  3. Inspect hreflang alternates and x-default.
  4. Verify each alternate points to the corresponding localized page.
  5. Verify reciprocal links exist from every locale.

Expected behavior: every localized canonical page should self-canonicalize and include reciprocal hreflang tags for all available locales plus x-default where appropriate.

Actual behavior: localization appears broad, but no automated guarantee was found.

Impact: wrong-language ranking, duplicate locale indexation, and weaker international SEO.

Proposed fix:

  • Add a hreflang/canonical validation script.
  • Generate alternates from route manifest data.
  • Fail builds when any locale URL lacks a reciprocal alternate.
  • Verify x-default behavior for root route.
  • Add tests for locale canonical tags.

Acceptance criteria:

  • Every indexable localized page has correct self-canonical.
  • Hreflang alternates are reciprocal.
  • x-default points to the intended root or language selector.
  • CI catches missing or mismatched alternates.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions