How to Add Hreflang Tags in WordPress (2026 Complete Guide)

How To Add Hreflang Tags In WordPress

You’ve built a multilingual WordPress site — or you’re planning to. Your content exists in English, Spanish, French, or a dozen other languages. But there’s a problem you might not even know you have: without hreflang tags, Google doesn’t know which version of your content to show which audience.

The result? Your French content shows up for Spanish speakers. Your UK pages compete against your US pages for the same rankings. Your German audience lands on your English homepage and immediately bounces. All of that work creating localized content — wasted, because search engines couldn’t route the right visitor to the right page.

Hreflang tags fix this. And in this guide, you’ll learn exactly how to implement them correctly in WordPress — from the easiest plugin-based methods to manual implementation for developers — plus how to test that they’re working and avoid the errors that affect over 75% of multilingual sites.

What Are Hreflang Tags?

Hreflang is an HTML attribute — introduced by Google in 2011 — that tells search engines two things about a page:

  1. What language the page is in
  2. Which geographic region it’s intended for

When Google encounters a hreflang tag, it uses that information to show the right language version of your content to the right user. A visitor searching from France with French browser settings gets your French page. A visitor searching from Mexico gets your Spanish (Latin America) page. A visitor in Australia gets your en-AU version.

Without hreflang, Google has to guess — and it frequently guesses wrong.

What a hreflang tag actually looks like in HTML:

html

<link rel=”alternate hreflang=”en-us href=”https://example.com/ />

<link rel=”alternate hreflang=”fr-fr href=”https://example.com/fr/ />

<link rel=”alternate hreflang=”de href=”https://example.com/de/ />

<link rel=”alternate hreflang=”x-default href=”https://example.com/ />

Breaking down the anatomy:

  • rel=”alternate” — tells Google this is an alternative version of another page
  • hreflang=”en-us” — the language code (en) and optional country code (us)
  • href=”https://example.com/” — the full, absolute URL of this language version
  • x-default — special value that tells Google which page to show when no other language version matches the user

These tags go inside the <head> section of every page. They can also be placed in your XML sitemap — we’ll cover both methods.

Why Hreflang Tags Matter for Your SEO

Both competitor guides on this topic touch on hreflang basics but skip the deeper strategic picture. Here’s what’s actually at stake:

1. Duplicate Content Protection

This is the most critical reason for most WordPress sites. If you have a UK English page and a US English page with very similar content, Google may flag them as duplicates and penalize both — or simply rank one and ignore the other, which may not be the version you want ranking in each market.

Hreflang tells Google: “These pages aren’t duplicates — they’re intentional language/region variants of the same content.” Google then treats them as a cluster, allowing each version to rank in its own target market without competing against each other.

As Google’s Gary Illyes has explained, pages in a hreflang cluster “should be able to use each other’s ranking signals” — meaning good links and authority earned by your English page can help your French page too.

2. Better User Experience and Lower Bounce Rates

Studies consistently show that users prefer content in their native language. When a French speaker lands on your English page because Google didn’t know a French version existed, they bounce immediately. That bounce signal hurts your rankings. Hreflang prevents the mismatch.

3. International Search Visibility

Without hreflang, your localized pages are invisible to the audiences they’re meant for. A Spanish page with no hreflang tag won’t reliably appear in searches from Spain or Mexico — Google doesn’t know it’s intended for Spanish speakers.

4. AI Search and 2026 Context

In 2026, AI-powered search features (Google AI Overviews, Bing Copilot) increasingly pull from structured, well-organized content. Sites with proper hreflang implementation give AI systems clear language and region signals — making it easier for those systems to surface the correct language version in generated answers for international queries.

Understanding Hreflang Language and Country Codes

Before implementing hreflang, you need to understand the code format — because using the wrong codes is one of the most common errors, and Google will silently ignore incorrectly formatted tags.

The format is: language-COUNTRY (language code is required, country code is optional)

Language codes use ISO 639-1 two-letter codes:

Language Code
English en
French fr
German de
Spanish es
Portuguese pt
Italian it
Japanese ja
Chinese (Simplified) zh
Arabic ar
Dutch nl
Russian ru
Korean ko

Country codes use ISO 3166-1 Alpha-2 codes:

Country Code Common Mistake
United States US
United Kingdom GB “UK” is wrong — must be “GB”
Canada CA
Australia AU
France FR
Germany DE
Spain ES
Mexico MX
Brazil BR
China CN
Japan JP

Common code combinations for multilingual WordPress sites:

Version Hreflang Code Example Tag
Generic English en hreflang="en"
US English en-US hreflang="en-US"
UK English en-GB hreflang="en-GB" (NOT en-UK)
Canadian English en-CA hreflang="en-CA"
Australian English en-AU hreflang="en-AU"
French (France) fr-FR hreflang="fr-FR"
French (Canada) fr-CA hreflang="fr-CA"
Spanish (Spain) es-ES hreflang="es-ES"
Spanish (Mexico) es-MX hreflang="es-MX"
Spanish (Latin America generic) es hreflang="es"
Portuguese (Brazil) pt-BR hreflang="pt-BR"
Portuguese (Portugal) pt-PT hreflang="pt-PT"
Chinese (Simplified, China) zh-CN hreflang="zh-CN"
Chinese (Traditional, Taiwan) zh-TW hreflang="zh-TW"
Default (no match) x-default hreflang="x-default"

Critical: Country codes are NOT always what you’d expect. The UK is GB, not UK. Latin America has no single code — use country-specific codes (es-MX, es-AR, es-CO) or the generic es for unspecified Spanish. Never use regional codes like eu (that’s Basque language, not the European Union), la (that’s Laotian), or en-us-gb (invalid — one tag per country).

The 3 URL Structures for Multilingual WordPress Sites

Before adding hreflang tags, you need to decide how to structure your multilingual URLs. There are three valid approaches, each with different SEO implications:

Option 1 — Subdirectories (Recommended for Most Sites)

https://example.com/          (English – default)

https://example.com/fr/       (French)

https://example.com/de/       (German)

https://example.com/es/       (Spanish)

Pros: All language versions benefit from your main domain’s authority. Easiest to set up with WordPress plugins. Most commonly recommended by Google.

Cons: Less geographic targeting signal than ccTLDs.

Option 2 — Subdomains

https://example.com           (English – default)

https://fr.example.com        (French)

https://de.example.com        (German)

https://es.example.com        (Spanish)

Pros: Each subdomain can be geotargeted separately in Google Search Console. More flexible hosting options.

Cons: Each subdomain starts with zero domain authority and must build it independently. More complex to set up.

Option 3 — Country-Code Top Level Domains (ccTLDs)

https://example.com           (English – default)

https://example.fr            (French)

https://example.de            (German)

https://example.es            (Spanish)

Pros: Strongest geographic targeting signal. Users see local domain which builds trust.

Cons: Most expensive (buying multiple domains). Each domain builds authority independently. Most complex to manage.

Our recommendation for WordPress sites: Subdirectories are the right choice for the vast majority of multilingual WordPress sites. They’re easier to set up with plugins, maintain shared domain authority, and Google handles them well. Use ccTLDs only if you have the budget, technical resources, and strong business reason for separate national domains.

Method 1: Translation Plugin (Recommended for Most WordPress Sites)

The easiest and most reliable way to add hreflang tags to WordPress is through a translation plugin. These plugins handle both the content translation and the technical hreflang implementation automatically.

Option A — Polylang (Free & Premium)

Polylang is one of the most widely used multilingual plugins for WordPress, with over 800,000 active installations. The free version handles hreflang tags automatically for sites using subdirectories or subdomains.

Setting up Polylang:

  1. Go to Plugins → Add New in your WordPress dashboard
  2. Search for “Polylang” and click Install Now, then Activate
  3. A setup wizard will launch — click Let’s start
  4. On the Languages screen, select each language your site will support and click Add
  5. For each language, configure:
    • The language name and code (Polylang pre-fills these — verify they’re correct)
    • The URL format (directory /fr/, subdomain fr., or custom domain)
    • Flag (optional, for switcher widget)
  6. On the Media screen, decide whether media should be shared across languages or duplicated
  7. On the Translations screen, choose whether to start with home page and sample page
  8. Complete setup

What Polylang does automatically:

  • Adds <link rel=”alternate” hreflang=”…”> tags to the <head> of every page
  • Includes self-referencing hreflang for every language version
  • Includes x-default pointing to your default language
  • Adds hreflang annotations to your XML sitemap (when used with Yoast SEO or Rank Math)

After setup — translating your content:

For every post or page, Polylang adds a “Translations” meta box in the editor. Click the “+” next to each language to create a linked translation. Polylang then automatically generates the correct hreflang relationship between the original and translated versions.

Polylang Pro ($99/year) adds: WooCommerce compatibility, custom post type translation, duplicate content for pages with similar layouts, and priority support.

Option B — WPML (WordPress Multilingual Plugin)

WPML is the market-leading premium multilingual plugin used by over 1 million WordPress sites. It’s more powerful than Polylang but costs $39–$199/year.

WPML plans:

  • Multilingual Blog ($39/year) — Posts, pages, and custom post types
  • Multilingual CMS ($99/year) — Adds WooCommerce, custom fields, themes
  • Multilingual Agency ($199/year) — Unlimited sites, all features

Setting up WPML:

  1. Purchase WPML from wpml.org and download the plugin files
  2. In WordPress, go to Plugins → Add New → Upload Plugin
  3. Upload and activate WPML
  4. Complete the setup wizard:
    • Choose your site’s default language
    • Add secondary languages
    • Choose URL format (directory, subdomain, or different domain)
    • Set language switcher display preferences
  5. Activate with your license key

What WPML does with hreflang:

WPML automatically generates hreflang tags in three places:

  • The <head> section of every page
  • Your XML sitemap (compatible with Yoast SEO and Rank Math)
  • HTTP headers (for server-level implementation)

For WooCommerce stores, WPML also handles hreflang on product pages, category pages, and checkout pages — a significant advantage over free options.

Option C — TranslatePress

TranslatePress takes a unique approach — you translate your content visually, by clicking directly on elements of your live site in the front-end editor. This makes it particularly beginner-friendly.

Setting up TranslatePress:

  1. Go to Plugins → Add New, search for “TranslatePress,” install and activate
  2. Go to Settings → TranslatePress
  3. Under the General tab, set your Default Language
  4. In the All Languages section, add secondary languages from the dropdown
  5. Save changes
  6. Visit any page on your site and click Translate Page in the admin bar to open the visual editor
  7. Click any text element to translate it inline

Hreflang with TranslatePress:

  • Free version: Adds hreflang tags to the <head> of all pages automatically
  • Premium SEO Pack add-on: Adds hreflang to your XML sitemap, adds language-specific SEO meta tags (title, description per language), and adds Open Graph tags per language

TranslatePress pricing:

  • Free: Core translation + head hreflang tags
  • Personal ($89/year, 1 site): Automatic translation, extra languages
  • Developer ($159/year, unlimited sites): All features

Method 2: Using Rank Math or Yoast SEO with a Multilingual Plugin

If you already use Rank Math or Yoast SEO for your SEO, here’s how hreflang integrates with each:

Rank Math + Polylang (Free — Our Recommended Combination)

This is the combination we recommend most frequently at WPDepend for multilingual WordPress sites. Both plugins are free, they integrate seamlessly, and the result is comprehensive hreflang coverage.

Setup:

  1. Install and configure Polylang (see Method 1, Option A above)
  2. Install Rank Math (free from WordPress.org)
  3. Run the Rank Math setup wizard and configure your site
  4. Go to Rank Math → Sitemap Settings and ensure XML Sitemap is enabled

What happens automatically:

  • Polylang generates hreflang tags in the <head> of every page
  • Rank Math generates the XML sitemap
  • The two plugins integrate to include hreflang annotations (<xhtml:link rel=”alternate” hreflang=”…”>) in the sitemap entries automatically
  • No additional configuration needed

Verify it’s working:

  1. Visit yourdomain.com/sitemap.xml
  2. Click into any post or page sitemap
  3. Look for entries like:

xml

<url>

  <loc>https://example.com/post-name/</loc>

  <xhtml:link rel=”alternate hreflang=”en href=”https://example.com/post-name/“/>

  <xhtml:link rel=”alternate hreflang=”fr href=”https://example.com/fr/post-name/“/>

</url>

Yoast SEO Premium + WPML or Polylang

Yoast SEO Free does not add hreflang tags on its own. Yoast SEO Premium does — but only when combined with a compatible multilingual plugin.

What Yoast SEO Premium adds ($99/year):

  • Hreflang in XML sitemap when used with WPML or Polylang
  • Language-specific SEO titles and meta descriptions
  • Multilingual breadcrumb support

Setup with Polylang:

  1. Install and configure Polylang
  2. Install Yoast SEO Premium (requires a $99/year license)
  3. Go to Yoast SEO → General → Features and ensure XML Sitemaps are ON
  4. The integration is automatic — Polylang feeds language data to Yoast’s sitemap

Important note: Yoast Free does not output hreflang tags. If you’re using Yoast Free, you need either Polylang (which adds head hreflang tags independently) or to upgrade to Yoast Premium for sitemap-level hreflang. Rank Math Free + Polylang achieves the same result at zero cost.

Method 3: Dedicated Hreflang Plugin (Without a Translation Plugin)

What if you’ve already built separate language versions of your site — perhaps on separate domains or subdomains, or built by different teams — and you don’t use a translation plugin? You can add hreflang relationships manually using a dedicated hreflang plugin.

Hreflang Manager (Free Plugin)

When to use this: Your site has separate language versions that already exist (e.g., example.com and example.de), but no multilingual plugin connecting them.

Setup:

  1. Install “Hreflang Manager” from WordPress.org (search for “Hreflang Manager Lite”)
  2. Activate the plugin
  3. Go to Settings → Hreflang Manager
  4. Click Add Rule
  5. For each rule, specify:
    • The source URL (a page on your site)
    • The alternate URL (the equivalent page on another language version)
    • The hreflang code for the alternate page (e.g., fr-FR)
  6. Save the rule
  7. Repeat for every page and every language version

The limitation: This works but is manual — you need to create individual rules for every page on every language version of your site. For a 50-page site with 3 languages, that’s 150 rules to create and maintain. For larger sites, this approach becomes unmanageable. Use a proper translation plugin instead.

Method 4: Adding Hreflang Tags in Your XML Sitemap Manually

For developers managing complex multilingual setups, you can add hreflang directly to your XML sitemap. This is one of Google’s officially supported implementation methods and has the advantage of centralized management — all your hreflang data is in one file rather than spread across every page’s <head>.

The XML sitemap hreflang format:

xml

<?xml version=”1.0″ encoding=”UTF-8″?>

<urlset xmlns=”http://www.sitemaps.org/schemas/sitemap/0.9

  xmlns:xhtml=”http://www.w3.org/1999/xhtml“>

  <url>

    <loc>https://www.example.com/en/page.html</loc>

    <xhtml:link

       rel=”alternate

       hreflang=”en

       href=”https://www.example.com/en/page.html“/>

    <xhtml:link

       rel=”alternate

       hreflang=”fr

       href=”https://www.example.com/fr/page.html“/>

    <xhtml:link

       rel=”alternate

       hreflang=”de

       href=”https://www.example.com/de/page.html“/>

    <xhtml:link

       rel=”alternate

       hreflang=”x-default

       href=”https://www.example.com/“/>

  </url>

  <url>

    <loc>https://www.example.com/fr/page.html</loc>

    <xhtml:link

       rel=”alternate

       hreflang=”en

       href=”https://www.example.com/en/page.html“/>

    <xhtml:link

       rel=”alternate

       hreflang=”fr

       href=”https://www.example.com/fr/page.html“/>

    <xhtml:link

       rel=”alternate

       hreflang=”de

       href=”https://www.example.com/de/page.html“/>

    <xhtml:link

       rel=”alternate

       hreflang=”x-default

       href=”https://www.example.com/“/>

  </url>

</urlset>

Every URL in the sitemap must include all language versions — not just its own hreflang tag. The reciprocal relationship must be reflected in the sitemap, just as it must in HTML implementation.

For WordPress sites, it’s almost always better to let a plugin (Rank Math + Polylang, or WPML) generate this sitemap automatically rather than creating it manually.

Method 5: Manual HTML Implementation (For Developers)

For developers who want complete control, or for static pages not managed by WordPress, you can add hreflang tags directly to your theme’s header.

Important: Only use this method if you’re a developer comfortable editing WordPress theme files. Use a child theme — never edit your parent theme directly, or your changes will be overwritten on the next theme update.

Adding static hreflang tags to header.php:

  1. Create a child theme if you haven’t already
  2. In your WordPress dashboard, go to Appearance → Theme File Editor
  3. Select your child theme and find header.php
  4. Locate the <head> section
  5. Add your hreflang tags before the closing </head> tag:

html

<link rel=”alternate hreflang=”en href=”https://example.com/ />

<link rel=”alternate hreflang=”fr href=”https://example.com/fr/ />

<link rel=”alternate hreflang=”de href=”https://example.com/de/ />

<link rel=”alternate hreflang=”es href=”https://example.com/es/ />

<link rel=”alternate hreflang=”x-default href=”https://example.com/ />

The limitation of static hreflang in header.php: This adds the same hreflang tags to every page. That only works correctly if every page on your site has the same language versions — which is rarely true. Normally, your About page exists in 3 languages, your blog posts in 2 languages, and some product pages only in 1 language. A single static hreflang block in header.php can’t handle this — it points every page’s hreflang to the homepage equivalents.

Better approach for developers: Use WordPress hooks to add dynamic hreflang tags that output differently on each page based on available translations:

php

// Add to child theme’s functions.php

function wpdepend_hreflang_tags() {

    if ( function_exists( ‘pll_the_languages’ ) ) {

        // Polylang is active — let Polylang handle hreflang

        return;

    }

    // Custom implementation for non-Polylang sites

    global $post;

    if ( ! $post ) return;

    // Add your dynamic hreflang logic here

}

add_action( ‘wp_head’, ‘wpdepend_hreflang_tags’ );

For truly dynamic hreflang implementation without a translation plugin, the code complexity increases significantly. At this point, using a plugin is almost always the better choice.

The 6 Hreflang Rules You Cannot Break

These are absolute requirements — not best practices. Violating any of them causes Google to ignore your hreflang tags entirely.

Rule 1 — Every Page Must Be Self-Referencing

Every page must include a hreflang tag pointing to itself. This is not optional.

Correct:

html

<!– On the English page –>

<link rel=”alternate hreflang=”en href=”https://example.com/ />

<link rel=”alternate hreflang=”fr href=”https://example.com/fr/ />

Wrong:

html

<!– On the English page — missing self-reference –>

<link rel=”alternate hreflang=”fr href=”https://example.com/fr/ />

Rule 2 — All Hreflang Relationships Must Be Reciprocal

If Page A lists Page B as an alternate, Page B must list Page A as an alternate. This is the most commonly violated rule and the one most likely to cause Google to ignore your entire hreflang setup.

Think of it like a link exchange that must work both ways. Google uses the reciprocal relationship to confirm that you control both pages and that the relationship is legitimate.

Correct:

html

<!– English page includes: –>

<link rel=”alternate hreflang=”en href=”https://example.com/ />

<link rel=”alternate hreflang=”fr href=”https://example.com/fr/ />

 

<!– French page must also include: –>

<link rel=”alternate hreflang=”en href=”https://example.com/ />

<link rel=”alternate hreflang=”fr href=”https://example.com/fr/ />

Wrong:

html

<!– English page includes French alternate –>

<link rel=”alternate hreflang=”fr href=”https://example.com/fr/ />

 

<!– French page doesn’t reference English page at all — BROKEN –>

Rule 3 — Use Absolute URLs, Not Relative URLs

Always use the full URL including the protocol and domain. Never use relative paths.

Correct: href=”https://example.com/fr/about/”

Wrong: href=”/fr/about/” or href=”fr/about/”

Rule 4 — Use Valid ISO Language and Country Codes

Only official ISO 639-1 language codes and ISO 3166-1 Alpha-2 country codes are recognized. Made-up or informal codes are silently ignored.

Common mistakes:

  • en-UK → ✅ en-GB
  • es-LA (Latin America — LA is the code for Laos) → ✅ es-MX, es-AR, or generic es
  • eu for European Union → eu is the code for Basque language
  • en-us-gb (combining two countries) → one tag per country: en-US and en-GB separately
  • zh-cn with lowercase → capitalization matters: zh-CN

Rule 5 — Include x-default for Unmatched Users

The x-default tag tells Google which page to show users whose language or region doesn’t match any of your specific language versions. Without it, Google has to guess — and may show the wrong version to users in markets you haven’t specifically targeted.

html

<link rel=”alternate hreflang=”x-default href=”https://example.com/ />

Point x-default to your most universal page — usually your English homepage, or a language selection page if you have one.

Rule 6 — Don’t Mix Implementation Methods

Choose one method — HTML head tags, XML sitemap, or HTTP headers — and stick to it. If a translation plugin is adding hreflang to your page <head> and you also manually add hreflang to header.php, you’ll have conflicting duplicate tags that confuse Google.

Common Hreflang Mistakes and How to Avoid Them

Beyond the absolute rules above, here are the mistakes that consistently trip up WordPress site owners implementing hreflang:

Mistake 1 — Thinking a Subdirectory URL Replaces Hreflang

Having /fr/ in your URL tells Google the content is probably French. But it’s not the same as an hreflang tag. Google might still show your French page to English speakers if it doesn’t understand the page’s intended audience. URL structure and hreflang work together — one doesn’t replace the other.

Mistake 2 — Forgetting Paginated Pages

If your blog archive, product category, or any paginated content exists in multiple languages, each paginated page needs its own hreflang tags. Most translation plugins handle this automatically, but if you’re implementing manually, don’t forget /fr/blog/page/2/ needs hreflang just as much as /fr/blog/.

Mistake 3 — Pointing Hreflang to Redirected URLs

All URLs in your hreflang tags must return a 200 status code — they must be live pages. If a URL redirects to another URL, Google may not follow the redirect when processing hreflang, causing the relationship to break. Check all your hreflang URLs with a tool like Screaming Frog to confirm they return 200, not 301 or 302.

Mistake 4 — Hreflang Tags on Noindexed Pages

If a page has a noindex meta tag, adding hreflang to it is pointless — Google won’t index the page and won’t process the hreflang. If you’re noindexing some language versions for any reason, remove their hreflang tags too.

Mistake 5 — Canonical Conflicts

Your canonical tags and hreflang tags must be consistent. A canonical tag that points to a different language version than what the hreflang declares creates conflicting signals that Google will struggle to interpret.

Rule of thumb: Each page’s canonical should point to itself (self-canonical). Don’t canonical your French page to your English page — use hreflang to declare the relationship instead.

Mistake 6 — Partial Implementation

One of the most damaging things you can do is implement hreflang on some pages but not others. If 50 of your 100 pages have hreflang and 50 don’t, Google’s understanding of your site’s language structure is inconsistent. Implement hreflang across all language versions of all pages — not selectively.

How to Test and Validate Your Hreflang Implementation

Over 75% of sites with hreflang tags have implementation errors, according to SEMrush research. Testing is not optional.

Test 1 — View Page Source Check (Quick)

Right-click any page on your site, select “View Page Source,” and press Ctrl+F (or Cmd+F). Search for hreflang. You should see:

  • A hreflang tag for every language version of your site
  • A self-referencing tag for the current page
  • An x-default tag
  • All URLs using https:// and the full domain

If you see no hreflang tags at all, your implementation hasn’t taken effect. If you see partial or incomplete tags, you likely have a configuration error in your translation plugin.

Test 2 — Google Search Console International Targeting Report

Google Search Console has an International Targeting report that appears only when hreflang tags are detected on your site:

  1. Log into Google Search Console
  2. Select your property
  3. Go to Legacy Tools → International Targeting
  4. Check the Language tab — it will show detected hreflang annotations

If this report doesn’t appear, Google hasn’t detected hreflang tags on your site. If it shows errors, the report will describe what’s wrong.

Note: This report takes time to populate after you first add hreflang tags. Allow 1–2 weeks for Google to crawl and process your site.

Test 3 — Ahrefs or Semrush Site Audit

Both Ahrefs and Semrush include hreflang validation in their site audit tools:

In Ahrefs Site Audit:

  • Run a site audit
  • Go to the Hreflang section
  • Look for: Missing return tags, invalid language codes, broken hreflang URLs, missing x-default

In Semrush Site Audit:

  • Run a site audit
  • Go to Issues → Hreflang Issues
  • Semrush categorizes errors by severity and provides specific fix recommendations

Test 4 — Merkle’s Hreflang Testing Tool

Merkle’s free hreflang validator (technicalseo.com/tools/hreflang/) is specifically designed for hreflang validation. Enter any URL and it checks:

  • All hreflang tags on the page
  • Whether reciprocal tags exist on the alternates
  • Whether language codes are valid
  • Whether all URLs return 200 status codes

Test 5 — XML Sitemap Verification

Visit yourdomain.com/sitemap.xml (or sitemap_index.xml). Click into your post sitemap and look for <xhtml:link rel=”alternate” hreflang=”…”> entries inside <url> blocks. If these aren’t present, your sitemap-level hreflang isn’t working — check your plugin settings.

Choosing the Right Hreflang Method: Decision Guide

Your Situation Recommended Method Cost
Starting a new multilingual WordPress site Polylang (free) + Rank Math (free) $0
New multilingual site, need WooCommerce support WPML CMS + Rank Math $99/year
Already using Yoast SEO, adding languages Polylang (free) + Yoast Premium $99/year
Large site, complex multilingual needs WPML Agency $199/year
Separate language sites already built, no translation plugin Hreflang Manager plugin $0
Developer with full theme control Dynamic PHP in functions.php $0
Non-technical user, visual translation TranslatePress Free or Pro $0–$159/year
Maximum automatic handling WPML + Rank Math $99/year

Hreflang Maintenance: Keeping It Working Over Time

Hreflang isn’t a one-time setup — it needs ongoing attention as your site grows and evolves.

When you publish new content: Your translation plugin should automatically create hreflang relationships when you add a translated version of a new post. Verify this is happening by checking the source of new pages after publishing.

When you delete pages: Removing a page without updating hreflang on its alternates creates broken references. Most translation plugins handle this automatically, but if you’re using manual implementation, you must update hreflang on all alternate pages when one is deleted.

When you change URLs: If you change a page’s permalink, you need to update hreflang references on all alternate pages. A translation plugin usually handles this. Manual implementation requires updating every reference manually.

Monthly check: Run a quick check in Google Search Console’s International Targeting report and look for any new hreflang errors. Catching issues early prevents them from compounding over time.

WPDepend’s Approach to Multilingual WordPress Maintenance

At WPDepend, we manage WordPress sites for clients across multiple markets and languages. Hreflang implementation is one of the technical SEO areas we include in our regular site audits — because it’s the kind of thing that silently breaks without anyone noticing until rankings drop.

What we see most often in multilingual WordPress site audits:

  • Missing reciprocal hreflang tags — the most common error, usually caused by translated pages being added without properly linking back to original pages
  • Invalid language codes (en-UK instead of en-GB is by far the most common)
  • Translation plugins configured but not generating sitemap-level hreflang — usually because the SEO plugin’s sitemap integration isn’t enabled
  • Hreflang pointing to redirected URLs rather than final 200-status pages
  • Canonical tags on translated pages pointing to the English version instead of being self-referencing

How we handle hreflang in our care plans:

For clients with multilingual sites, we include hreflang validation in our monthly SEO health checks. We run Ahrefs site audits, verify GSC International Targeting reports, and confirm that plugin updates haven’t broken hreflang integration. Hreflang implementation errors are subtle — they don’t break your site visibly, they just quietly cost you international traffic month after month.

Our WordPress care plans include SEO health monitoring, technical audit checks, security monitoring, performance optimization, and priority support — all for a flat monthly rate. If you’re running a multilingual WordPress site and want to ensure your hreflang implementation is correct and staying correct, we can help.

Visit wpdepend.com/wordpress-care-plans/ to learn more about our WordPress maintenance services.

Frequently Asked Questions About Hreflang Tags in WordPress

What is hreflang and do I need it for my WordPress site?

Hreflang is an HTML attribute that tells Google and other search engines what language a page is written in and which geographic region it’s intended for. You need it if your WordPress site has content in more than one language, or if you have the same language version tailored for different countries (for example, separate US and UK versions of your English site).

If your WordPress site is entirely in one language and targets one country, you don’t need hreflang. But if you have a French page and an English page covering the same topics, or a US English site and a UK English site, hreflang is essential — without it, Google may flag your pages as duplicate content and rank neither of them properly.

Does WordPress automatically add hreflang tags?

No. WordPress core does not add hreflang tags. You need either a translation plugin (like Polylang, WPML, or TranslatePress), a combination of a translation plugin with an SEO plugin (like Polylang + Rank Math), or manual implementation in your theme’s header or XML sitemap.

The easiest and most reliable approach for most WordPress sites is installing Polylang (free) alongside Rank Math (free) — this combination automatically handles hreflang in both page headers and your XML sitemap, with no additional configuration needed.

What is the x-default hreflang tag and should I use it?

The x-default hreflang tag (hreflang=”x-default”) tells Google which page to show users whose language or country doesn’t match any of your specific language versions. It acts as a catch-all fallback.

For example, if your site has English (US), French (France), and German (Germany) versions, a visitor from Japan — where you don’t have a local version — would be directed to whichever URL you’ve set as x-default.

You should use it. Point it to your most universal page — typically your main English homepage or a language-selection landing page if you have one. Most translation plugins add x-default automatically when properly configured.

How do I know if my hreflang tags are working correctly?

Check using these four methods:

  1. View page source: Right-click any page → View Page Source → search for hreflang. You should see self-referencing tags and alternates for all language versions.
  2. Google Search Console: Go to Legacy Tools → International Targeting → Language tab. This report shows detected hreflang and any errors Google has found.
  3. Merkle’s hreflang validator (technicalseo.com/tools/hreflang/): Enter any URL for a full reciprocal check.
  4. XML sitemap check: Visit yourdomain.com/sitemap.xml and look for <xhtml:link rel=”alternate” hreflang=”…”> entries inside URL blocks.

Allow 1–2 weeks after implementing hreflang for Google to crawl and fully process the tags before expecting to see results in Search Console.

Can I have hreflang tags for the same language but different countries?

Yes — and this is often necessary. If you sell products in both the US and Australia in English, you’d use en-US for your American pages and en-AU for your Australian pages. Even though both are in English, the regional variants can have different pricing, products, spelling conventions, or regulatory requirements.

Similarly, Canada requires both en-CA (English Canadian) and fr-CA (French Canadian) variants. Switzerland has four official languages (German, French, Italian, Romansh) so may need de-CH, fr-CH, it-CH variants.

The rule is: any time you have meaningfully different content for users in different regions or countries — even if they speak the same language — you should use region-specific hreflang codes.

Does hreflang affect my rankings for single-language pages?

Hreflang is specifically for multilingual and multi-regional sites. If your WordPress site is entirely in one language targeting one country, hreflang has no effect on your rankings and is not needed.

However, if you have even a small multilingual component — for example, a site that’s 90% English but has a few Spanish blog posts — hreflang is still relevant for those specific pages. For those pages, implementing hreflang correctly prevents the multilingual pages from being treated as duplicate content and ensures they appear in the right regional search results.

Summary: Your Hreflang Implementation Checklist

Use this checklist to implement and verify hreflang on your WordPress site:

Setup:

  • Decided on URL structure (subdirectory, subdomain, or ccTLD)
  • Installed translation plugin (Polylang, WPML, or TranslatePress)
  • Configured language settings in plugin
  • Connected translation plugin with SEO plugin (Rank Math or Yoast)
  • Created translated versions of all key pages and posts

Verification:

  • Checked page source for hreflang tags on multiple pages
  • Verified self-referencing hreflang on every page
  • Verified x-default tag is present
  • Confirmed hreflang codes use valid ISO language and country codes
  • Checked XML sitemap for hreflang annotations
  • Ran Merkle hreflang validator on key pages
  • Checked Google Search Console International Targeting report

Ongoing:

  • Set reminder to check GSC International Targeting monthly
  • Confirmed new translated pages are getting hreflang automatically
  • Plugin update protocol includes checking hreflang still works after updates
svg%3E
Written ByDhruva Khanna

A seasoned technology writer and marketing consultant with over a decade of experience helping businesses grow online. I specialize in content marketing, SEO, web design, and e-commerce development. I am enthusiastic about using cutting-edge technology to acquire high-quality traffic, generate leads, and increase sales for my clients.