# Favor links to the same language

- Check 28.01 · Multilingual linking and schema · Important
- Source: https://checklist-seo-geo.com/en/multilingual-linking-schema/favor-links-same-language
- Point the internal links of each language version to pages in the same language, measure the leaks and fix templates and content.
- Updated on 2026-11-25
- Licence: CC BY 4.0. Credit “Checklist SEO & GEO” with a link to https://checklist-seo-geo.com/en/multilingual-linking-schema/favor-links-same-language.
- Plugin checklist-seo-geo: 1.3.1 · https://github.com/maximegaul/checklist-seo-geo

## 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:

```js
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:

```python
#!/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)
```

```bash
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](https://checklist-seo-geo.com/en/international-architecture/provide-crawlable-language-switcher) |
| 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](https://checklist-seo-geo.com/en/multilingual-linking-schema/fix-links-default-language) |

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:

```html
<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
<?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
<?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:

```liquid
<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:

```txt
<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:

```twig
<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:

```php
// 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`:

```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:

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

export const { Link, redirect, usePathname, useRouter } = createNavigation(routing);
```

```ts
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

### Can a multilingual site link its pages to another language?

Yes, in two cases. The language switcher should link each page to its equivalents, as Google recommends. A link to content that only exists in another language is also acceptable, provided you flag it in the text, for example “in English”, and with the link's hreflang attribute. All other internal links of a version should stay in its language.

### Do links to another language hurt SEO?

There is no penalty for a link to another language. The effect is indirect: translated pages receive fewer links from their own version, are less well connected and are sometimes discovered only through hreflang annotations or the sitemap. The visitor, meanwhile, switches language without having chosen to. Fixing these links mainly improves the consistency of each version and the user journey.

### How do you measure internal links that switch language?

Crawl the site, export all internal links with their source page and destination, then assign a language to each URL based on its prefix, subdomain or domain. Count the links for each pair of source language and target language, excluding the language switcher. The links off the diagonal of this matrix need to be reviewed one by one.

### Do translation plugins fix links automatically?

Partly. Plugins that translate the displayed page, such as Weglot or TranslatePress, adapt internal links in principle. WPML offers a tool that points links in the content to the existing translations. Polylang, Shopify and Drupal do not rewrite links typed by hand in a text. In every case, check with a crawl: buttons, custom fields and scripts often escape these mechanisms.

## Resources

- [Google Search Central: Managing multi-regional and multilingual sites](https://developers.google.com/search/docs/specialty/international/managing-multi-regional-sites?hl=en)
- [Google Search Central: Link best practices](https://developers.google.com/search/docs/crawling-indexing/links-crawlable?hl=en)
- [W3C: Indicating the language of a link destination](https://www.w3.org/International/questions/qa-link-lang)
- [Polylang: Function reference](https://polylang.pro/documentation/support/developers/function-reference/)
- [WPML: wpml_object_id hook](https://wpml.org/wpml-hook/wpml_object_id/)
- [Shopify: routes Liquid object](https://shopify.dev/docs/api/liquid/objects/routes)
- [Webflow: Localized SEO and locale routing](https://help.webflow.com/hc/en-us/articles/33961235675155-Localized-SEO-and-locale-routing)
- [next-intl: Navigation](https://next-intl.dev/docs/routing/navigation)

Next steps: [fix links to the default language](https://checklist-seo-geo.com/en/multilingual-linking-schema/fix-links-default-language) and [translate anchor text](https://checklist-seo-geo.com/en/multilingual-linking-schema/translate-anchor-text).
