Skip to content

The publication for web craftspeople Monday, 23 November 2026

Marketing & SEO

hreflang with Polylang: Common Mistakes and How to Check Them in Search Console

Polylang generates hreflang tags automatically, but several default settings quietly produce errors: untranslated pages, a missing x-default, conflicts with a third-party SEO plugin. This guide covers the pitfalls specific to Polylang and how to check them without Search Console's now-retired dedicated report.

Polylang adds hreflang tags to every page without manual setup, which creates a false sense of security. In practice, several of the plugin’s settings and a few configuration blind spots produce errors that are invisible on the site itself, yet quietly distort international targeting in search results. This guide covers the pitfalls specific to Polylang, how to check them in the page source, and what’s still possible to verify in Google Search Console now that its dedicated international-targeting report is gone.

Why hreflang under Polylang deserves separate treatment

On a multilingual site built with Polylang, hreflang tags aren’t added by a separate SEO plugin: they come straight out of Polylang’s core, in the <head>, as soon as the corresponding option is enabled under Languages > Settings > URL modifications. That native integration has a real upside — no page-by-page manual setup — but it also has a consequence many sites discover too late: if a translation doesn’t exist, gets unpublished, or if an SEO plugin running alongside also generates its own tags, the two mechanisms can step on each other without any error showing up anywhere.

The one setting that turns everything on or off

Automatic hreflang generation hinges on a single checkbox in Polylang’s URL settings: “Automatically add the hreflang attributes output.” If that box is unchecked — which happens after a migration or a plugin reinstall — no tags are produced, and nothing in the admin interface flags the gap. The first thing to check on an existing site is therefore this setting, before hunting for subtler errors.

The most common errors seen in production

Once the option is enabled, the errors that recur most often on Polylang sites trace back to four distinct causes.

The first concerns untranslated pages: Polylang only shows an hreflang link to a language if content actually exists for it. A post published only in French keeps showing up with no alternative in the English or Spanish versions of the site, which is technically correct, but becomes a problem if the editorial team mistakenly believes the translation is live.

The second involves the x-default attribute, which tells search engines which version to serve a visitor whose language matches none of the available ones. Polylang only generates it if a default language is explicitly set, and never does so automatically on taxonomies or archive pages, even when the box is checked for regular content.

The third comes from third-party SEO plugins: both Yoast SEO and Rank Math ship an hreflang-generation option that can stay enabled by default after installation. When Polylang and one of these plugins each produce their own tags, the page ends up with duplicate hreflang entries, sometimes contradictory ones if the two systems don’t point to the same canonical URL.

The fourth is tied to caching: a plugin like WP Rocket, or a server-side cache layer, can keep serving a cached version of the <head> after a new translation is added, delaying the corresponding hreflang link’s appearance for crawlers by hours or even days.

SymptomMost likely causeFix
No hreflang tags anywhere on the siteAutomatic generation option uncheckedRe-enable it under Languages > Settings > URL modifications
Page shown to visitors from the wrong languageMissing x-default on taxonomies or archivesSet a default language and check archive templates
Duplicate hreflang tags in the headSimultaneous generation by Polylang and an SEO pluginDisable hreflang generation in the SEO plugin, keep Polylang as the single source
New translation missing from hreflang for daysPage or server cache not purgedPurge the cache after each translation goes live, exclude the head from caching if possible

Checking hreflang tags in practice

The most reliable check remains reading the raw source sent to the browser, via Ctrl+U or curl, rather than an audit tool that can itself misread a Polylang-specific setup. A correctly generated header looks like this:

<link rel="alternate" hreflang="fr" href="https://example.com/fr/my-post/" />
<link rel="alternate" hreflang="en" href="https://example.com/en/my-post/" />
<link rel="alternate" hreflang="es" href="https://example.com/es/mi-articulo/" />
<link rel="alternate" hreflang="x-default" href="https://example.com/en/my-post/" />

For a programmatic check — in a pre-deployment QA task, for example — a PHP script run in a WordPress context can list the translations actually registered for a given post, without depending on HTML rendering:

<?php
// Run via wp-cli eval-file or a temporary diagnostic shortcode
$post_id = 42;
$languages = pll_languages_list();

foreach ( $languages as $lang ) {
    $translated_id = pll_get_post( $post_id, $lang );
    if ( $translated_id ) {
        echo $lang . ' => ' . get_permalink( $translated_id ) . PHP_EOL;
    } else {
        echo $lang . ' => NO TRANSLATION' . PHP_EOL;
    }
}

This script immediately reveals which languages have no registered translation, which often explains why certain URLs never show up in the hreflang tags despite a translation being visible on the site: the content exists, but the link between the two posts through Polylang was never correctly established when it was created.

An automatically generated hreflang tag is not a verified one: Polylang never flags a missing translation with a visible error in the admin.

What’s still checkable in Google Search Console

Google retired Search Console’s dedicated international-targeting report in 2022, which used to show hreflang errors detected during crawling directly. That check no longer exists in that form, and no equivalent replacement report has been introduced since. Two indirect approaches remain available, though. The URL Inspection tool shows the actually crawled HTML for a given page, including the hreflang tags as Google saw them during its last pass, which confirms a fix has been picked up after a fresh crawl. The Performance report, filtered by country and page, helps spot the symptoms of bad targeting: an English-language page getting most of its clicks from France almost always signals an hreflang or redirect problem, even though Search Console never identifies the exact cause.

After any Polylang configuration fix, force a fresh crawl through URL Inspection rather than waiting for Googlebot’s natural pass: otherwise the gap between a fix and its showing up in performance reports can stretch to several weeks on a site with a low crawl frequency.

Edge cases worth watching

Archive pages and custom taxonomies remain the most common weak spot: Polylang natively handles posts and pages, but hreflang generation on a custom taxonomy depends on it being correctly registered as translatable in Polylang’s settings, an optional step many setups skip. The XML sitemap also deserves a cross-check: a sitemap plugin that ignores Polylang’s translation relationships can list URLs in one language without ever surfacing their equivalents, depriving Google of a discovery signal that complements the hreflang tags themselves.

What to take away

Polylang generates hreflang tags without heavy configuration, but that automation hides errors that produce no signal in the admin: an option unchecked after a migration, a missing x-default on archives, duplicates from a third-party SEO plugin, or a cache delaying a new translation’s visibility. The only reliable check remains reading the actual source sent to the browser, backed up by Search Console’s URL Inspection tool to confirm what Google actually crawled.

On most Polylang sites I audit, the problem is never the plugin itself but a box that got checked and later unchecked without anyone noticing, or an SEO plugin installed afterward that quietly started generating its own hreflang tags. The practical takeaway: treat hreflang generation as an explicit pre-deployment QA checkpoint, not as something settled for good once the box is checked the first time. — Simon Janvier

Further reading: Polylang’s official documentation covers how URL settings and hreflang work in detail. Mail Studio previously published a general guide to diagnosing hreflang errors, as well as an article on running a site with GA4 and Search Console.

Read next