# Fix links to the default language

- Check 28.02 · Multilingual linking and schema · Important
- Source: https://checklist-seo-geo.com/en/multilingual-linking-schema/fix-links-default-language
- Find the links in translated versions that point to the default language, replace them with the translated page or remove them, templates included.
- 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/fix-links-default-language.
- Plugin checklist-seo-geo: 1.3.1 · https://github.com/maximegaul/checklist-seo-geo

## In short

On most multilingual sites, link leaks go one way: from the translated versions to the default language, the one the site was written in. The task is to list these links, find for each one the equivalent page in the source page's language, then fix them: replace the URL when the translation exists, remove or flag the link when it does not, and fix the template when the link comes from it. Once it is done, a German page only links to a French page through the language switcher or through a deliberate, clearly announced link.

## Why it matters

Links to the default language have mechanical causes, which repeat with every new translation:

- the translator, human or machine, translates the text and keeps the original URL;
- a template contains a relative link without a prefix (`/contact/`) that always leads to the language served at the root;
- a custom menu link was entered once, hard-coded, in the original language;
- untranslated content is replaced by a link to the original version.

Google determines the language of a page from its visible content and recommends links to a page's other language versions, not internal linking that mixes languages. Each link from a German page to a French page switches the visitor's language without their choosing, takes an internal link away from the German version and gives one more to the default language, which is already the best connected. On a recent version, these links can make up a large share of the internal linking, and some translated pages are no longer linked from any page in their language: see [identify orphan pages by language](https://checklist-seo-geo.com/en/multilingual-linking-schema/identify-orphan-pages-language).

## What it improves

- **Visitor journey**: no more unintended switches to the original language.
- **Internal linking of each version**: translated pages receive the links that belong to them.
- **Crawling**: crawlers that follow the links of a version stay in it and discover the translated pages there.
- **Perceived translation quality**, for visitors and reviewers alike. A plausible effect on conversion, not measured in isolation.
- **Rankings**: an indirect effect only.

## How to check

Use the matrix of links by language described in [favor links to the same language](https://checklist-seo-geo.com/en/multilingual-linking-schema/favor-links-same-language): it produces `liens-hors-langue.csv`, the list of links whose target language differs from the source language, switcher excluded. Filter the rows whose target language is the default language.

Then diagnose the cause from the distribution:

| Clue in the export | Likely cause |
|---|---|
| Same destination from every page of a language, Navigation or Footer position | Template, menu or footer |
| Destination linked from a few pages, Content position | Link entered in the content and not adapted |
| Destination with no equivalent in the language | Missing translation, fallback link |
| Relative link without a prefix in the source code | Link hard-coded in the theme |

To check a page, view its source code and look for `href="/` followed by a path with no language prefix, or `href="https://example.com/` followed by a path in the default language.

Expected result: no row pointing to the default language, apart from listed and justified exceptions.

## How to implement

### Step 1 — Build the mapping table

To replace a link, you need to know the translated URL of each page. If your sitemaps carry `hreflang` annotations, this dependency-free Python script builds the table and suggests a replacement for each link in `liens-hors-langue.csv`:

```python
#!/usr/bin/env python3
"""Usage: python3 remplacer.py https://example.com/sitemap.xml liens-hors-langue.csv"""
import csv
import gzip
import sys
import urllib.request
import xml.etree.ElementTree as ET

SM = "{http://www.sitemaps.org/schemas/sitemap/0.9}"
XHTML = "{http://www.w3.org/1999/xhtml}"


def fetch(url):
    request = urllib.request.Request(url, headers={"User-Agent": "audit-liens"})
    with urllib.request.urlopen(request) as response:
        data = response.read()
    return gzip.decompress(data) if data[:2] == b"\x1f\x8b" else data


def collect(url, table):
    root = ET.fromstring(fetch(url))
    for loc in root.findall(f"{SM}sitemap/{SM}loc"):
        collect(loc.text.strip(), table)
    for entry in root.findall(f"{SM}url"):
        alternates = {
            link.get("hreflang").lower().split("-")[0]: link.get("href")
            for link in entry.findall(f"{XHTML}link")
            if link.get("rel") == "alternate" and link.get("hreflang") != "x-default"
        }
        for href in alternates.values():
            table.setdefault(href, {}).update(alternates)
    return table


table = collect(sys.argv[1], {})
writer = csv.writer(sys.stdout)
writer.writerow(["source", "destination", "langue_source", "remplacement"])

with open(sys.argv[2], encoding="utf-8") as handle:
    for row in csv.DictReader(handle):
        target = table.get(row["destination"], {}).get(row["langue_source"], "NO TRANSLATION")
        writer.writerow([row["source"], row["destination"], row["langue_source"], target])
```

```bash
python3 remplacer.py https://example.com/sitemap.xml liens-hors-langue.csv > corrections.csv
```

If the `hreflang` annotations are in the HTML rather than in the sitemap, export them from the `Hreflang` tab of Screaming Frog, after ticking `Store Hreflang` and `Crawl Hreflang` in `Configuration > Spider > Crawl`, or from the CMS.

### Step 2 — Decide what to do when the translation does not exist

| Situation | Decision |
|---|---|
| Content link to a page with no translation, secondary page | Remove the link or replace it with a related translated page |
| Link to an important untranslated page | Translate the page, then replace the link |
| Useful resource with no planned equivalent (documentation, study) | Keep the link while flagging the language: “(in French)” and `hreflang="fr"` on the link |
| Menu or footer link to a page with no translation | Remove the entry from that language's menu |
| Legal page (legal notice, terms of sale) | Create the version adapted to the country, see [translate anchors, menus and footer](https://checklist-seo-geo.com/en/translating-seo-elements/translate-anchors-menus-footer) |

Missing translations in general are covered in [plan for missing translations](https://checklist-seo-geo.com/en/international-architecture/plan-missing-translations).

> **Warning:** do not fix these links with a redirect that depends on the browser language or the IP address. Crawlers do not send this information and would always see the original page; see [avoid forced redirects based on browser language](https://checklist-seo-geo.com/en/international-architecture/avoid-forced-redirects-based-browser-language).

### Step 3 — Fix the templates first

One fixed template link settles hundreds of rows at once. In the theme, replace each hard-coded internal URL with a URL generated for the current language, as described for each CMS and framework in [favor links to the same language](https://checklist-seo-geo.com/en/multilingual-linking-schema/favor-links-same-language). Look for candidates in the code:

```bash
grep -rn --include='*.php' --include='*.twig' --include='*.liquid' --include='*.blade.php' --include='*.tsx' -E 'href="/[a-z0-9-]+' themes/ resources/ src/ 2>/dev/null
```

Then the menus: a custom link entered in the original language must be recreated in the menu of each language.

### Step 4 — Fix the content

Work from `corrections.csv`, language by language, starting with the pages that get the most visits. The method depends on the environment, detailed below; step 5 comes after.

### WordPress

Versions: WordPress 6.8 and later (checked up to 7.1); WPML 4 and 5, Polylang 3, WP-CLI 2.

With WPML, start with `WPML > Settings`, “Translate Link Targets” section, button to scan and adjust links: WPML points the links in the content to the existing translations. Then run the crawl again: links in page builder fields can escape it.

For the rest, and with Polylang, this WP-CLI script replaces the URLs listed in `corrections.csv` in the content of a single language, in dry-run mode by default. Back up the database first (`wp db export`).

```php
<?php
// Usage: wp eval-file corriger-liens.php de corrections.csv [apply]
[$lang, $file] = $args;
$apply = ($args[2] ?? '') === 'apply';

$map = [];
$handle = fopen($file, 'r');
fgetcsv($handle);

while (($row = fgetcsv($handle)) !== false) {
    [, $old, $rowLang, $new] = $row;

    if ($rowLang !== $lang || ! str_starts_with($new, 'http')) {
        continue;
    }

    $map["href=\"{$old}\""] = "href=\"{$new}\"";
    $map['href="' . wp_make_link_relative($old) . '"'] = "href=\"{$new}\"";
}

do_action('wpml_switch_language', $lang);

$ids = get_posts([
    'post_type' => 'any',
    'post_status' => 'publish',
    'numberposts' => -1,
    'fields' => 'ids',
    'lang' => $lang,
    'suppress_filters' => false,
]);

foreach ($ids as $id) {
    $content = get_post_field('post_content', $id);
    $fixed = strtr($content, $map);

    if ($fixed === $content) {
        continue;
    }

    WP_CLI::log("Content {$id}: links to fix");

    if ($apply) {
        wp_update_post(['ID' => $id, 'post_content' => $fixed]);
    }
}
```

```bash
wp eval-file corriger-liens.php de corrections.csv
wp eval-file corriger-liens.php de corrections.csv apply
```

The `lang` parameter is for Polylang; `suppress_filters` and the `wpml_switch_language` action are for WPML. The script only handles `post_content`: content from Elementor or other page builders, stored in metadata, is fixed in the translation's editor. Each update creates a revision, which lets you roll back.

### Shopify

Versions: Online Store 2.0 themes and the Translate & Adapt app, all Shopify plans, November 2026.

Links entered in translated descriptions, pages and blog posts are fixed in Translate & Adapt: open the resource, target language, and replace the URL in the translated field. In the theme, replace hard-coded paths with `{{ product.url }}`, `{{ collection.url }}` or the `routes` object, which take the language into account.

### PrestaShop

Versions: PrestaShop 8 and 9.

Each description field exists per language: open the product or CMS page, choose the language in the field's language selector, and replace the links. In link modules (Link Widget, main menu), check that a custom URL is entered for each language.

### Drupal

Versions: Drupal 10 and 11.

Open the content's “Translate” tab, edit the translation and fix the links in the body. For menu links, make custom menu links translatable, then translate their target.

### Webflow

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

Replace links entered as URLs with “Page” or “Collection page” links: only those point to the current locale.

### Laravel

Versions: Laravel 11 to 13.

In content stored in the database, save a reference to the page (its identifier) rather than its URL, and resolve it at render time with `route()` in the current language. To fix existing content, apply `corrections.csv` in an Artisan command that only loads the content of the language concerned, with a dry-run option enabled by default, modeled on the WordPress script above.

### Next.js

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

In content coming from a headless CMS, transform internal links at render time with next-intl's `Link`, which adds the current language's prefix. Absolute links to the default language must be fixed in the CMS, field by field.

### Step 5 — Prevent it from coming back

- Add to the translation brief: “replace each link with the URL of the page in the target language”.
- Run the matrix again after each batch of translations and at each scheduled crawl.
- Block any new hard-coded template link during acceptance testing, see [test cross-language links](https://checklist-seo-geo.com/en/multilingual-tracking-maintenance/test-cross-language-links).

## Common mistakes

- **Replacing a URL globally across the whole database**: the original page, which legitimately links to its own language, gets broken in turn.
- **Forgetting relative links**: the content contains `/tarifs/`, the crawl export `https://example.com/tarifs/`.
- **Replacing with the language's homepage** when the translation is missing: the link becomes misleading.
- **Fixing content before templates**: most rows come back at the next crawl.
- **Ignoring page builders** and custom fields, which replacement tools do not read.
- **Not purging caches** after the fix: the old version keeps being served.

## Frequently asked questions

### Why do translated pages link to the default language?

Most often, the translation reused the original text with its links, without changing the URLs. Next come links hard-coded in the theme, custom menu links entered only once, and fallback links to an untranslated page. A matrix of links by source language and target language, taken from a crawl, quickly shows which of these causes dominates.

### Should you remove a link when the page is not translated?

Not always. Remove it if the linked page is secondary, or replace it with a related translated page. If the page is important, translate it. If it is a useful resource with no planned equivalent, keep the link while stating the language in the text, for example “in French”, and with the link's hreflang attribute, so the visitor knows they are switching language.

### Can a redirect replace fixing the links?

No. A redirect based on the browser language or the IP address does not apply to crawlers, which do not send this information: they keep following the link to the original page. It also prevents a visitor from deliberately opening the version of their choice. Fix the link's URL at the source, in the content or the template, and keep stable URLs for each language.

### Does WPML automatically fix internal links in translations?

Partly. In its settings, WPML offers a “Translate Link Targets” feature that finds internal links in the content and points them to the existing translations. It handles standard content well, less so some page builder or theme fields. Run it after each batch of translations, then check the result with a crawl and the matrix of links by language.

## 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: Localized versions of your pages](https://developers.google.com/search/docs/specialty/international/localized-versions?hl=en)
- [W3C: Indicating the language of a link destination](https://www.w3.org/International/questions/qa-link-lang)
- [WPML: wpml_switch_language hook](https://wpml.org/wpml-hook/wpml_switch_language/)
- [WP-CLI: eval-file command](https://developer.wordpress.org/cli/commands/eval-file/)
- [Shopify: Support multiple languages in a theme](https://shopify.dev/docs/storefronts/themes/markets/multiple-currencies-languages)

Next steps: [translate anchor text](https://checklist-seo-geo.com/en/multilingual-linking-schema/translate-anchor-text), [check related content, footer and in-article links](https://checklist-seo-geo.com/en/multilingual-linking-schema/check-related-content-footer-article-links) and [identify orphan pages by language](https://checklist-seo-geo.com/en/multilingual-linking-schema/identify-orphan-pages-language).
