惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

Microsoft Azure Blog
Microsoft Azure Blog
博客园_首页
Forbes - Security
Forbes - Security
WordPress大学
WordPress大学
P
Proofpoint News Feed
T
Threat Research - Cisco Blogs
L
LINUX DO - 热门话题
L
Lohrmann on Cybersecurity
Spread Privacy
Spread Privacy
D
Darknet – Hacking Tools, Hacker News & Cyber Security
大猫的无限游戏
大猫的无限游戏
博客园 - 三生石上(FineUI控件)
P
Privacy International News Feed
A
About on SuperTechFans
T
Tailwind CSS Blog
I
InfoQ
S
Securelist
云风的 BLOG
云风的 BLOG
罗磊的独立博客
Recent Announcements
Recent Announcements
T
The Exploit Database - CXSecurity.com
B
Blog RSS Feed
V
Visual Studio Blog
Know Your Adversary
Know Your Adversary
The GitHub Blog
The GitHub Blog
Jina AI
Jina AI
腾讯CDC
Cyberwarzone
Cyberwarzone
有赞技术团队
有赞技术团队
AWS News Blog
AWS News Blog
博客园 - 【当耐特】
cs.AI updates on arXiv.org
cs.AI updates on arXiv.org
F
Full Disclosure
S
Secure Thoughts
博客园 - 司徒正美
J
Java Code Geeks
Y
Y Combinator Blog
Google Online Security Blog
Google Online Security Blog
GbyAI
GbyAI
N
News and Events Feed by Topic
Help Net Security
Help Net Security
freeCodeCamp Programming Tutorials: Python, JavaScript, Git & More
Project Zero
Project Zero
T
Tenable Blog
cs.CV updates on arXiv.org
cs.CV updates on arXiv.org
T
Tor Project blog
MyScale Blog
MyScale Blog
Scott Helme
Scott Helme
小众软件
小众软件
K
Kaspersky official blog

DEV Community

Authentication Security Deep Dive: From Brute Force to Salted Hashing (With Java Examples) Why AI Systems Don’t Fail — They Drift Spilling beans for how i learn for exam😁"Reinforcement Learning Cheat Sheet" I Replaced Chrome with Safari for AI Browser Automation. Here's What Broke (and What Finally Worked) How Python Borrows Other People's Work The $40 Architecture: Processing 1 Billion API Requests with 99.99% Uptime Vibe Coding: A Workflow Guide (From Zero to SaaS) Most webhook security guides protect the wrong side. The scary part is delivery. Headless CMS for TanStack Start: Build a Blog with Cosmic EU Age Verification App "Hacked in 2 Minutes" — What Actually Happened Comfy Cloud’s delete function does not actually remove files Running AI Models on GPU Cloud Servers: A Beginner Guide Event-driven media intelligence with AWS Step Functions and Bedrock I scored 500 AI prompts across 8 quality dimensions — here's what broke How to Call Google Gemini API from Next.js (Free Tier, No Backend Needed) The Portal Protocol: Reclaiming Human Connection in the Age of AI How to Fix Your Team's Scattered Knowledge Problem With a Self-Hosted Forum Intro to tc Cloud Functors: A Graph-First Mental Model for the Modern Cloud Designing Multi-Tenant Backends With Both Ownership and Team Access I Built a Neumorphic CSS Library with 77+ Components — Here's What I Learned PostgreSQL Performance Optimization: Why Connection Pooling Is Critical at Scale Cómo construí un SaaS multi-rubro para gestionar expensas en Argentina con FastAPI + Vue 3 🚀 I Built an Ethical Hacking Scanner Tool – Open Source Project I Replaced /usage and /context in Claude Code With a Single Statusline A Pythonic Way to Handle Emails (IMAP/SMTP) with Auto-Discovery and AI-Ready Design I Collected 8.9 Million Polymarket Price Points — Here's What I Found About How Markets Really Move EcoTrack AI — Carbon Footprint Tracker & Dashboard Everyone's Using AI. No One Agrees How. 5 self-hosted ebook managers worth trying in 2026 Building Your First AI Agent with LangChain: From Chatbot to Autonomous Assistant Common SOC 2 Failures (Real World) Stop Vibe-Checking Your AI App: A Practical Guide to Evals How to Use SonarQube and SonarScanner Locally to Level Up Your Code Quality Your Next To-Do App Is Dead — I Replaced Mine with an OpenClaw AI Sign a Nostr event in 60 lines of Python using coincurve — no nostr-sdk, no nbxplorer, no rust toolchain ITGC Audit Explained Like You’re in Big 4 Patch Tuesday abril 2026: Microsoft parcha 163 vulnerabilidades y un zero-day en SharePoint Stop scraping everything: a better way to track competitor price changes Listing on MCPize + the Official MCP Registry while routing payments OUTSIDE the marketplace — how I kept 100% of my x402 revenue Building an AI-Powered Risk Intelligence System Using Serverless Architecture Why We Ripped Function Overloading Out of Our AI Toolchain Testing AI-Generated Code: How to Actually Know If It Works SaaS Churn Is Killing Your Business. Here Is What to Do About It (Without a Support Team) The Speed of AI Is No Longer Linear - And Self-Improving Models Are Why How to Implement RBAC for MCP Tools: A Practical Guide for Engineering Teams From Standard Quote to Persuasive Proposal: AI Automation for Arborists I built a CLI that scaffolds complete multi-tenant SaaS apps Axios CVE-2025–62718: The Silent SSRF Bug That Could Be Hiding in Your Node.js App Right Now The dashboard that ended our friendship Data Pipelines Explained Simply (and How to Build Them with Python) The Hidden Cost of AI Systems Nobody Talks About. undefined vs undeclared, and how typeof behaves Switching from file-based jobs to NATS/Kafka in Rust without changing code io_uring Adventures: Rust Servers That Love Syscalls Why Agentic AI is Killing the Traditional Database The POUR principles of web accessibility for developers and designers Quantum Neural Network 3D — A Deep Dive into Interactive WebGL Visualization How To Install Caveman In Codex On macOS And Windows Automation Pipeline Reliability: Why Your Workflow Breaks When Nobody Is Watching I Built an 'Open World' AI Coding Agent — It Works From ANY Folder From Freelancing to Product: A Tech Service Company's SaaS Transformation China's AI Giants: Adding Tencent Hunyuan & ByteDance Doubao to AI University (74 Providers) On the Vibe Coders and Their Lies clerk: Auto-Summarize Your Claude Code Sessions AI Weekly — 2026/04/10–04/17 | The Model Lockdown Is Here, but the Toolchain Is the Real Battleground AI 週報 — 2026/04/10–2026/04/17 模型封鎖潮來了,但工具鏈才是真戰場 Maybe this is how Open-Source apps are born... 🚀 Fine-Tune LLMs with LoRA and QLoRA: 2026 Guide tRPC v11 + Next.js App Router: End-to-End Type Safety Without the Boilerplate ShadCN UI in 2026: Why I Stopped Installing Component Libraries and Started Owning My Components SaaS Billing in React Server Components: Stripe + Supabase Without a Single `useEffect` Join our DEV Weekend Challenge — $1,000 in Prizes Across TEN winners! Submissions Due April 20 at 6:59 AM UTC. Implementing FSRS Spaced Repetition in Flutter + Supabase — Adding Memory Science to an AI Learning App "I Texted My Localhost From the Train — Claude Code Fixed the Bug Before I Got Home" I Built a Sales Prep AI and It Went Deeper Than Expected Design to Code #2: One JSON, Eleven Outputs Solving the 100M-Row Problem: A Summary Table Pattern for High-Volume Push Notification Logs Flutter Web With Wasm: What Actually Changes For Developers I Built 50 Royalty-Free Soundtracks for My Side Project in a Weekend Using AI Music Generation The Vibe Coding Security Checklist: 7 Things to Check Before You Ship Stop Letting Googlebot Guess Fix Your React App's SEO Right Desconstruindo o Streaming do LinkedIn: Como Criar um Engine de Extração de Vídeo de Alta Performance com HLS e FFmpeg (EDA Part-1) EDA (Exploratory Data Analysis) Explained With Real Life — Why Looking at Your Data Is the Most Important Step in Machine Learning Brand Relationship Management at Scale: Our 4-Touch Outreach System for 200+ Brands Why String.fromEnvironment() Might Return an Empty String in Dart JGuardrails 1.0.0 — Hardening Java LLM Apps Against Jailbreaks, Toxicity, and Prompt Injection Plan and Schedule a Full Week of Threads Content From One Claude Conversation Coding Cat Oran Ep3, Five Tables Changed Everything Updated: BFF Pattern I'm done watching freelancers get buried by 200 proposals. So I'm building the alternative. This is my first post BFS Algorithm in Java Step by Step Tutorial with Examples Tracking LLM Pricing Monthly: An Open Dataset for 22 AI Models How We Measure Content ROI on a Comparison Site: Revenue Attribution Without Perfect Data Introducing Nova AI Ops: The AI-Native Operating System for SRE Teams I built a free desktop video downloader for Windows — Grabbit How Talkie OCR Helps Vision-Impaired & Dyslexic Users Read the World Around Them VRCFaceTracking安装和iPhone面捕配置教程,有bug Even CrowdStrike Can't See Your Agents The Automation Gold Rush: What n8n Workflows and Claude Are Opening Up for Developers Right Now
How I Fixed the Canonical and Hreflang Mess on My Multilingual Website
SeanX · 2026-04-27 · via DEV Community

A multilingual website with language switcher showing different flags

I run Animate Old Photos, an AI-powered tool that brings old photographs to life. The site supports multiple languages — English, Spanish, Portuguese, French, and more. Sounds great in theory. In practice, I had a silent SEO problem that took me a while to notice: my canonical and hreflang tags were misconfigured across pages that didn't have full language coverage.

If your website has multilingual support but not every page is translated into every language, this article is for you. I'll walk through the exact scenarios I encountered, what I did wrong, and how I fixed it — with concrete code examples.

The Problem: Not Every Page Has Every Language

Here's the reality of running a multilingual site: your product pages might be fully translated, but your blog posts and changelog entries often aren't. On Animate Old Photos, I had three types of pages:

  1. Fully translated pages — available in all supported languages (e.g., homepage, pricing)
  2. Partially translated pages — available in some languages but not all (e.g., a blog post in English, Spanish, and Portuguese, but not French)
  3. English-only pages — only the English version exists (e.g., some newer blog posts)

The question is: what happens when a French user visits a blog post that doesn't have a French version? And more importantly, how should you configure canonical and hreflang for each of these scenarios?

What I Was Doing Wrong

Before fixing things, my site had two main issues.

Issue 1: The blog listing page showed untranslated content.

On the French blog page (/fr/blog), the page title, navigation, and category headings were all in French, but the article cards themselves — titles, descriptions, and even the "Read more" buttons — were in English. It looked broken.

Screenshot of /fr/blog page before the fix showing a mix of French headers and untranslated English blog post cards

Issue 2: Fallback pages had wrong canonical and hreflang tags.

Pages like /fr/blog/how-to-restore-old-photos-online-free-ai were serving English content but declaring themselves as independent French pages with canonical pointing to themselves and hreflang listing French as an available language. This confused search engines — they saw duplicate English content across multiple URLs and couldn't determine which was the authoritative version.

HTML source code showing incorrect self-referencing canonical and hreflang tags on a fallback language page

The Fix: Three Scenarios, Three Configurations

Let me break down exactly how I configured canonical and hreflang for each scenario.

Scenario 1: Page Is Fully Translated

A page like the pricing page exists in English, Spanish, Portuguese, and French. Every version has real translated content.

<!-- /en/pricing -->
<link rel="canonical" href="https://animateoldphotos.org/en/pricing" />
<link rel="alternate" hreflang="en" href="https://animateoldphotos.org/en/pricing" />
<link rel="alternate" hreflang="es" href="https://animateoldphotos.org/es/pricing" />
<link rel="alternate" hreflang="pt" href="https://animateoldphotos.org/pt/pricing" />
<link rel="alternate" hreflang="fr" href="https://animateoldphotos.org/fr/pricing" />
<link rel="alternate" hreflang="x-default" href="https://animateoldphotos.org/en/pricing" />

Enter fullscreen mode Exit fullscreen mode

<!-- /fr/pricing -->
<link rel="canonical" href="https://animateoldphotos.org/fr/pricing" />
<link rel="alternate" hreflang="en" href="https://animateoldphotos.org/en/pricing" />
<link rel="alternate" hreflang="es" href="https://animateoldphotos.org/es/pricing" />
<link rel="alternate" hreflang="pt" href="https://animateoldphotos.org/pt/pricing" />
<link rel="alternate" hreflang="fr" href="https://animateoldphotos.org/fr/pricing" />
<link rel="alternate" hreflang="x-default" href="https://animateoldphotos.org/en/pricing" />

Enter fullscreen mode Exit fullscreen mode

The rule: Each translated page's canonical points to itself. All translated versions cross-reference each other via hreflang. The x-default points to English as the fallback.

Scenario 2: Page Is Partially Translated

A blog post exists in English, Spanish, and Portuguese — but not French. This was the trickiest scenario for me.

The translated pages (EN, ES, PT) reference each other, but do NOT include French:

<!-- /en/blog/animate-old-photos-guide -->
<link rel="canonical" href="https://animateoldphotos.org/en/blog/animate-old-photos-guide" />
<link rel="alternate" hreflang="en" href="https://animateoldphotos.org/en/blog/animate-old-photos-guide" />
<link rel="alternate" hreflang="es" href="https://animateoldphotos.org/es/blog/animate-old-photos-guide" />
<link rel="alternate" hreflang="pt" href="https://animateoldphotos.org/pt/blog/animate-old-photos-guide" />
<link rel="alternate" hreflang="x-default" href="https://animateoldphotos.org/en/blog/animate-old-photos-guide" />
<!-- No hreflang="fr" — because French version doesn't exist -->

Enter fullscreen mode Exit fullscreen mode

Spanish and Portuguese pages follow the same pattern — canonical to self, hreflang only among EN/ES/PT.

The French fallback page gets special treatment:

<!-- /fr/blog/animate-old-photos-guide (displays English fallback content) -->
<link rel="canonical" href="https://animateoldphotos.org/en/blog/animate-old-photos-guide" />
<!-- No hreflang tags at all -->

Enter fullscreen mode Exit fullscreen mode

The canonical points to the English original, not to itself. No hreflang tags. This tells search engines: "This is not an independent page. The real content lives at the English URL."

Scenario 3: Page Is English-Only

Some of my newer blog posts only exist in English. No translations at all.

<!-- /en/blog/chrome-extension-tutorial -->
<link rel="canonical" href="https://animateoldphotos.org/en/blog/chrome-extension-tutorial" />
<!-- No hreflang needed — only one language version exists -->

Enter fullscreen mode Exit fullscreen mode

That's it. No hreflang at all. It only serves a purpose when there are multiple language versions to cross-reference.

If the French URL (/fr/blog/chrome-extension-tutorial) is still accessible and shows English fallback content:

<!-- /fr/blog/chrome-extension-tutorial (fallback) -->
<link rel="canonical" href="https://animateoldphotos.org/en/blog/chrome-extension-tutorial" />
<!-- No hreflang -->

Enter fullscreen mode Exit fullscreen mode

Same pattern as Scenario 2 — canonical to English, no hreflang.

Beyond Meta Tags: What I Changed in the UI

Getting the meta tags right was only half the battle. I also made changes to how untranslated content appears to users.

Blog Listing Pages: Hide Untranslated Posts

On /fr/blog, I stopped showing articles that don't have a French translation. Previously, the French blog page was a mess — French headings mixed with English article cards. Now, it only shows articles that actually have French content.

Clean French blog listing page on Animate Old Photos showing only fully translated French articles

At the bottom of the page, I added a link for users who want more: "Voir plus d'articles en anglais" (View more articles in English), linking to the English blog.

Language Switcher: Only Show Available Languages

On any given page, the language switcher now only displays languages for which a real translation exists. If a blog post is only in English and Spanish, the switcher shows just those two — no French or Portuguese option.

Optimized language switcher dropdown showing only languages where a translation is available for the current page

Fallback Pages: Show a Notice Banner

For product and tool pages (not blog posts), if a user lands on a URL like /fr/pricing but there's no French version, I show the English content with a notice bar at the top — written in French so the user can understand it:

Cette page n'est pas encore disponible en français. Vous consultez la version anglaise.

This way, the user knows what's happening and isn't confused by the language mismatch.

Open Graph Tags on Fallback Pages

One detail that's easy to miss: the og:url on fallback pages should also point to the English original, matching the canonical.

<!-- /fr/blog/some-post (fallback, showing English content) -->
<meta property="og:url" content="https://animateoldphotos.org/en/blog/some-post" />
<meta property="og:locale" content="en" />

Enter fullscreen mode Exit fullscreen mode

This ensures that when someone shares the French URL on social media, the preview card pulls from the canonical English version instead of showing a confusing mix of French URL with English content.

The Decision Framework

After going through this process, I boiled it down to a simple decision framework:

Does this page have a real translation in this language?

  • Yes → canonical points to self, include in hreflang cross-references
  • No, but the URL is accessible → canonical points to English original, no hreflang
  • No, and the URL doesn't exist → Nothing to configure (404 or redirect to English)

Should untranslated content be visible in this language?

  • Blog/content pages → Don't show in listing pages. If URL is directly accessed, either redirect or show fallback with notice.
  • Product/tool pages → Show English fallback with notice banner. Hide from language switcher.

Common Mistakes to Avoid

From my experience fixing Animate Old Photos, here are the mistakes I'd warn others about:

1. Declaring hreflang for languages that don't have real translations. If /fr/blog/post shows English content, don't include hreflang="fr" in the tag set. It tells Google that a French version exists when it doesn't.

2. Setting canonical to self on fallback pages. If /fr/blog/post displays English content, its canonical must point to /en/blog/post. Otherwise, Google sees two URLs with identical English content and has to guess which is authoritative.

3. Forgetting about og:url. Social sharing metadata should be consistent with your canonical setup. Mismatched og:url and canonical creates confusion for social platforms.

4. Leaving the html lang attribute as the URL language. If /fr/pricing displays English fallback content, <html lang="fr"> is technically incorrect — the content is English. Ideally set it to lang="en". In practice, if changing this is complex in your framework, it's a minor issue — Google doesn't rely on the lang attribute for language detection.

5. Including untranslated pages in your sitemap for that language. Your French sitemap should only list URLs with actual French content. Fallback pages should not appear.

Wrapping Up

Multilingual SEO isn't just about translating content — it's about correctly signaling to search engines which pages are real translations and which are fallbacks. The canonical and hreflang tags are your primary tools for this, but they need to be paired with thoughtful UI decisions about what to show (and what to hide) from users in each language.

If you want to see these changes in action, check out the blog and changelog sections on Animate Old Photos — switch between languages and see how untranslated content is handled differently from fully translated pages.


I built Animate Old Photos to help people bring their old family photos to life using AI. If you have questions about multilingual website configuration or want to share your own approach, feel free to reach out.