Check 28.01 · Multilingual linking and schema

Favor links to the same language

Point the internal links of each language version to pages in the same language, measure the leaks and fix templates and content.

Priority
Important
Difficulty
Intermediate
Estimated time
2 h to 2 days
Free, no account: your progress is saved in this browser.

Ask an AI to check this point on your site

Opens the assistant with a ready-made question: this check, its goal and your site URL.

For Gemini, Copilot or another assistant, copy the question. The link opens the chosen service directly: nothing goes through this site.

In short

On a multilingual site, every internal link on a German page must lead to a German page, with two deliberate exceptions: the language switcher, and an intentional link to content that only exists in another language, flagged as such. The task is to measure the share of links that switch language, to generate URLs with the language tools of the CMS or framework rather than hard-coding them, and to keep this habit for every new page. Once it is done, a visitor or a crawler who enters a version stays in it until they choose to leave.

Why it matters

Google determines the language of a page from its visible content, and it recommends adding links on each page to its other language versions. It says nothing more about internal linking by language; what follows derives from how internal links work in general.

Internal links do three things: they help pages get discovered, they signal their relative importance, and they describe their topic through the anchor text. Google points out that every important page should receive a link from at least one other page of the site. When German pages link to French pages:

  • the German-speaking visitor switches language without asking to, often in the middle of a purchase journey;
  • German pages receive fewer links from their own version, and some are only connected through the switcher or the hreflang annotations;
  • internal link equity concentrates on the default language, which is already the best served;
  • generative engine crawlers that follow links to complete an answer land on a page in a different language from the question's.

The flaw is rarely visible from the main language: it shows up when you read the site in a secondary language, or in a crawl.

What it improves

  • Visitor journey Fewer unwanted language switches, fewer drop-offs. A likely effect on conversion, rarely measured in isolation.
  • Crawling by language Each version forms a connected set that crawlers explore without depending on hreflang.
  • Relative importance of translated pages They receive the links of their own version instead of giving them up to the default language.
  • Consistency for generative engines A source page and its linked pages in the same language. No practice guarantees a citation.
  • Rankings An indirect effect, through crawling and internal linking.

How to check

Quick check on one page: in the browser console, list the internal links that leave the page's language, with their area:

const lang = document.documentElement.lang.slice(0, 2);
const zone = (a) => a.closest('header, nav, footer, aside')?.tagName.toLowerCase() ?? 'content';

[...document.querySelectorAll('a[href]')]
  .filter((a) => a.hostname === location.hostname)
  .filter((a) => !a.pathname.startsWith(`/${lang}/`))
  .map((a) => `${zone(a)} | ${a.textContent.trim()} -> ${a.pathname}`);

Expected result: only the language switcher's links leave. If the default language has no prefix, run the test from a secondary language.

Across the whole site: crawl with Screaming Frog (free up to 500 URLs), then Bulk Export > Links > All Inlinks. This dependency-free Python script computes the matrix of links by source language and target language, and lists the links that switch language:

#!/usr/bin/env python3
"""Internal link matrix by language. Usage: python3 matrice.py all_inlinks.csv"""
import csv
import re
import sys
from collections import Counter

DEFAULT = "fr"                                  # language served without a prefix
LANGS = {"fr", "de", "en", "es"}
SWITCHER = {"Français", "Deutsch", "English", "Español", "FR", "DE", "EN", "ES"}
PREFIX = re.compile(r"^https?://[^/]+/([a-z]{2})(?:[-_][a-z]{2})?(?:/|$)", re.I)


def lang_of(url):
    match = PREFIX.match(url)
    code = match.group(1).lower() if match else DEFAULT
    return code if code in LANGS else DEFAULT


matrix = Counter()
writer = csv.writer(sys.stdout)
writer.writerow(["source", "destination", "ancre", "position", "langue_source", "langue_cible"])

with open(sys.argv[1], encoding="utf-8-sig") as handle:
    for row in csv.DictReader(handle):
        if row.get("Type", "Hyperlink") != "Hyperlink":
            continue
        if row.get("Anchor", "").strip() in SWITCHER:
            continue
        src, dst = lang_of(row["Source"]), lang_of(row["Destination"])
        matrix[(src, dst)] += 1
        if src != dst:
            writer.writerow([row["Source"], row["Destination"], row.get("Anchor", ""),
                             row.get("Link Position", ""), src, dst])

for (src, dst), count in sorted(matrix.items()):
    print(f"{src} -> {dst} : {count}", file=sys.stderr)
python3 matrice.py all_inlinks.csv > liens-hors-langue.csv

Adapt DEFAULT, LANGS and SWITCHER (the switcher's anchors) to your site. For subdomains or country domains, replace lang_of with a host-to-language table.

Expected result: the diagonal (de -> de, en -> en) holds almost all the links, and each line of liens-hors-langue.csv matches an intended exception.

Source \ Target fr de en
fr 18,420 3 0
de 1,312 9,870 0
en 96 0 7,954

Fictitious example: 1,312 German links lead to French pages, to be fixed first.

How to implement

Before you start

Set the rule and its exceptions in writing, for developers and writers:

Case Rule
Navigation, content or footer link Page in the same language
Language switcher Equivalent page in each language, see provide a crawlable language switcher (opens in a new tab)
Content that does not exist in the language Do not link, translate the page, or link while flagging the language (below)
Equivalent page missing, template link Remove the link from that version, see fix links to the default language (opens in a new tab)

When a link to another language is intended, tell the reader. The W3C suggests stating the target's language in the text and carrying the information with the link's hreflang attribute:

<a href="https://example.com/en/whitepaper/" hreflang="en">Full white paper (in English)</a>

The technical principle is the same everywhere: never hard-code an internal URL. Generate it from the content identifier and the current language.

WordPress

Versions WordPress 6.8 and later (checked up to 7.1); WPML 4 and 5, Polylang 3, TranslatePress 3, Weglot 6.

  • Polylang: in a template, get the translation of a piece of content with pll_get_post(), then its URL:
<?php
$pricingId = pll_get_post(42); // 42: ID of the pricing page in the original language

if ($pricingId) {
    printf('<a href="%s">%s</a>', esc_url(get_permalink($pricingId)), esc_html(get_the_title($pricingId)));
}

Without a translation, pll_get_post() returns nothing and the link is not displayed. Polylang does not document any automatic rewriting of links entered in the content: check them with the script from the previous section.

  • WPML: use the wpml_object_id filter, with false as the third argument to get nothing when the translation is missing:
<?php
$pricingId = apply_filters('wpml_object_id', 42, 'page', false);

if ($pricingId) {
    printf('<a href="%s">%s</a>', esc_url(get_permalink($pricingId)), esc_html(get_the_title($pricingId)));
}

For links in the content, WPML offers a “Translate Link Targets” section in WPML > Settings that finds internal links and points them to the existing translations. Run it after an import or a bulk translation, then check the result: links in some page builder fields escape it.

  • TranslatePress and Weglot: they translate the displayed page and, in principle, adapt internal links to the current language. Check absolute links entered in buttons, custom fields or scripts.

Shopify

Versions Online Store 2.0 themes, all Shopify plans, November 2026.

Liquid objects return URLs that take the language into account: {{ product.url }} gives /products/the-vert on the main store and /de/products/the-vert on the German version. Shopify recommends not hard-coding URLs in themes and using the routes object:

<a href="{{ routes.collections_url }}">{{ 'general.collections' | t }}</a>
<a href="{{ product.url }}">{{ product.title }}</a>

Links entered in a product description or a blog post are not rewritten: fix the URL in the translated text, in Translate & Adapt.

PrestaShop

Versions PrestaShop 8 and 9, Classic and Hummingbird themes.

In Smarty templates, use the $link object, which generates the URL in the context language when you do not specify a language:

<a href="{$link->getCategoryLink(12)}">{l s='Green teas' d='Shop.Theme.Catalog'}</a>
<a href="{$link->getCMSLink(4)}">{l s='Delivery' d='Shop.Theme.Global'}</a>

In descriptions entered in the back office, each language has its own field: replace the links copied from the original version.

Drupal

Versions Drupal 10 and 11.

In Twig, generate links by route rather than by path; Drupal adds the prefix and alias of the current language:

<a href="{{ path('entity.node.canonical', {'node': 12}) }}">{{ 'Pricing'|t }}</a>

Links entered by hand in the body of content (/tarifs) are not translated: fix them in each translation.

Webflow

Versions Webflow with Localization, paid site plans, November 2026.

With Webflow Localization, only links of the “Page” or “Collection page” type point to the page of the current locale. A link entered as a URL leads to the primary version: replace it with a page-type link.

Laravel

Versions Laravel 10 to 13.

With routes prefixed by {locale}, set the parameter's default value in a middleware, once and for all:

// app/Http/Middleware/SetLocaleUrlDefault.php
public function handle(Request $request, Closure $next): Response
{
    URL::defaults(['locale' => $request->route('locale') ?? app()->getLocale()]);

    return $next($request);
}

route('pricing') then produces /de/preise on a German page, without each view having to pass the language. In content stored in the database, save identifiers rather than URLs, and resolve them at render time.

The Laravel documentation asks for this middleware to run before SubstituteBindings, otherwise implicit model binding can fail. Only the place where it is registered changes from one version to another.

Laravel 11 to 13

In bootstrap/app.php:

use App\Http\Middleware\SetLocaleUrlDefault;
use Illuminate\Foundation\Configuration\Middleware;
use Illuminate\Routing\Middleware\SubstituteBindings;

->withMiddleware(function (Middleware $middleware): void {
    $middleware->web(append: [
        SetLocaleUrlDefault::class,
    ]);

    $middleware->prependToPriorityList(
        before: SubstituteBindings::class,
        prepend: SetLocaleUrlDefault::class,
    );
})

Laravel 10

In app/Http/Kernel.php, add \App\Http\Middleware\SetLocaleUrlDefault::class to the web group of $middlewareGroups, just before \Illuminate\Routing\Middleware\SubstituteBindings::class. Laravel 10 has not received security fixes since February 2025: plan the upgrade.

Next.js

Versions Next.js 15 and 16 (App Router), next-intl 3.22 and 4.

With next-intl, use the Link created by createNavigation(routing), which adds the current language's prefix:

// src/i18n/navigation.ts
import { createNavigation } from 'next-intl/navigation';
import { routing } from './routing';

export const { Link, redirect, usePathname, useRouter } = createNavigation(routing);
import { Link } from '@/i18n/navigation';

<Link href="/pricing">{t('pricing')}</Link>;

Do not import next/link with a hard-coded path in shared components.

Nuxt

Versions Nuxt 3 and 4, @nuxtjs/i18n module 9 and 10.

With the @nuxtjs/i18n module, use <NuxtLinkLocale to="/pricing"> or useLocalePath(): the path is prefixed according to the current language.

Astro

Versions Astro 5 to 7, built-in i18n routing.

With built-in internationalization, build URLs with getRelativeLocaleUrl(Astro.currentLocale, 'pricing'), imported from astro:i18n.

Common mistakes

  • Copying and pasting the original content into the translation without changing the link URLs: this is the main source of links to the default language.
  • Relative links without a prefix (/contact/) in a shared template: they all lead to the language served at the root.
  • Counting the language switcher as a leak: exclude it from the measurement, otherwise every page looks faulty.
  • Linking without warning to a page in another language: the visitor does not know they are switching language.
  • Fixing it with a redirect based on the browser language: this hides the faulty link and hinders crawlers, which do not send a language.
  • Testing only the main language, where the flaw cannot be seen.

Frequently asked questions

Updated on

Topic checklist (PDF)

And now?

In the “Multilingual linking and schema” topic

  1. Favor links to the same language
  2. Fix links to the default language
  3. Translate anchor text
  4. Check the language switcher on every page
  5. Check related content, footer and in-article links
  6. Identify orphan pages by language
  7. Build clusters for each market
  8. Check click depth and link equity distribution
  9. Use inLanguage on compatible types
  10. Translate name and description
  11. Adapt url to the language
  12. Keep a stable organization @id
  13. Create a distinct @id for each page
  14. Translate FAQ and Article markup
  15. Adapt Product and priceCurrency
  16. Adapt areaServed and contact details
  17. Check availability by country
  18. Check sameAs
  19. Validate the markup for each language