Skip to content

fix(seo): declare canonical URLs for unversioned and untranslated page copies - #2432

Merged
bjohansebas merged 2 commits into
mainfrom
fix-canonical
Jul 5, 2026
Merged

fix(seo): declare canonical URLs for unversioned and untranslated page copies#2432
bjohansebas merged 2 commits into
mainfrom
fix-canonical

Conversation

@bjohansebas

Copy link
Copy Markdown
Member

Technically, these pages contain the same content, just for i18n purposes. Because of that, we keep a canonical pointing to the English page so Google can index it more effectively.

It would also be good to exclude them from the sitemap, but I'd consider that a future improvement since I haven't found a clean way to do it yet.

Also, the reason I chose the unversioned URLs to point to the latest version (v5) is that Google was already treating the v5 URLs as the canonical ones.

By the way, I have access to Google Search Console, so I can actually verify this.

@bjohansebas
bjohansebas requested a review from a team as a code owner July 5, 2026 03:27
@netlify

netlify Bot commented Jul 5, 2026

Copy link
Copy Markdown

Deploy Preview for expressjscom-preview ready!

Name Link
🔨 Latest commit 47eaa0e
🔍 Latest deploy log https://app.netlify.com/projects/expressjscom-preview/deploys/6a49d14a752ddb0008444a65
😎 Deploy Preview https://deploy-preview-2432--expressjscom-preview.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.
Lighthouse
Lighthouse
1 paths audited
Performance: 99 (🟢 up 2 from production)
Accessibility: 100 (no change from production)
Best Practices: 100 (no change from production)
SEO: 100 (no change from production)
PWA: 80 (no change from production)
View the detailed breakdown and full score reports
🤖 Make changes Run an agent on this branch

To edit notification comments on pull requests, go to your Netlify project configuration.

Comment thread src/layouts/Layout.astro
/>
))
!isBlogOrApi &&
['x-default', ...languageCodes].map((altLang) => (

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is so that if none of the available languages match the user's language, it falls back to English.

@bjohansebas
bjohansebas merged commit e253310 into main Jul 5, 2026
17 of 20 checks passed
@bjohansebas
bjohansebas deleted the fix-canonical branch July 5, 2026 03:42
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