Skip to content

fix(seo): canonical URLs on marketing pages + drop same-URL hreflang#17

Merged
Manuel10i merged 1 commit into
mainfrom
fix/canonicals-and-sitemap
Jul 5, 2026
Merged

fix(seo): canonical URLs on marketing pages + drop same-URL hreflang#17
Manuel10i merged 1 commit into
mainfrom
fix/canonicals-and-sitemap

Conversation

@Manuel10i

Copy link
Copy Markdown
Owner

What

Canonical-tag and hreflang correctness for the marketing pages.

Canonical tags

Before this, only destination pages emitted a <link rel="canonical">. Home, /map, /best-time and the 7 feature pages had none. /map in particular syncs week/year into the URL query string (useUrlSync), so those variants could be indexed as separate URLs. Added explicit absolute canonicals, following the existing destination-page convention (https://packedplaces.com/...). The map canonical lives in the (map)/map/layout.tsx server layout because the page itself is a client component.

Sitemap hreflang

Removed the static-page hreflang alternates. They listed en/de/es/fr/x-default all pointing at the same URL (locale is negotiated, not path-prefixed), which signals nothing to search engines. Destination clusters with genuinely distinct de/en slugs are unchanged; destinations without a German exonym now correctly emit no alternates instead of a same-URL set.

Intentionally not changed

/compare stays out of the sitemap and gets no canonical: it is robots: { index: false } (content depends on the visitor's saved places). So its absence from the sitemap is correct, not a bug.

Verify

  • npx tsc --noEmit and eslint pass on all changed files.
  • robots.test.ts passes. (The repo's component render tests fail on React.act is not a function on main too — a pre-existing testing-library/React env mismatch, unrelated to this PR.)

Only destination pages set a canonical before this. Home, /map, /best-time
and the feature pages had none, so query-param variants (the map syncs
week/year into the URL) risked being indexed as separate URLs. Add explicit
absolute canonicals, matching the destination-page convention.

Also removes the static-page hreflang alternates from the sitemap. They
listed en/de/es/fr/x-default all pointing at the same URL (language is
negotiated, not path-prefixed), which signals nothing to search engines.
Destination clusters with genuinely distinct de/en slugs are unchanged;
destinations without a German exonym now correctly emit no alternates.

/compare is intentionally left out of the sitemap and uncanonicalised: it
is robots noindex (content depends on the visitor's saved places).

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
@Manuel10i Manuel10i merged commit 65e7026 into main Jul 5, 2026
2 checks passed
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