Hreflang for WordPress Multilingual Teams

Generate and validate hreflang tags for WordPress multilingual sites. Works with WPML, Polylang, and any WordPress multilingual setup.

Your site runs WPML. You've set up the language switcher, translated the key pages, and the plugin tells you it's handling hreflang automatically. So you move on to other things.

Six months later an SEO audit finds that your German pages are missing return links on every post-type template, your hreflang codes are using the wrong region format, and Google has been largely ignoring the whole thing since launch.

The plugin was "handling it." You just didn't know what handling it actually meant in practice.

The plugin trust problem

Multilingual WordPress plugins like WPML and Polylang do generate hreflang. That's not the issue. The issue is that plugin-generated hreflang can be subtly wrong in ways that are hard to see without a dedicated validator, and "subtly wrong" in hreflang is functionally the same as "not there."

Common plugin-generated hreflang problems:

  • Language codes that don't match ISO standards (en_US with an underscore, zh-CN when you meant Traditional Chinese)
  • Missing hreflang on specific post types or taxonomies that the plugin doesn't cover by default
  • Self-referencing tags missing from certain page templates
  • Return links breaking when translated pages use different URL structures than expected
  • hreflang getting dropped entirely on paginated archive pages
  • Canonical and hreflang conflicts when plugins apply canonical redirects for language detection

These aren't hypotheticals -- they're the actual errors that show up when you validate plugin output on real WordPress sites. The plugin isn't broken. It's doing what it was configured to do. The problem is that it's hard to know whether the configuration is correct without checking the output.

Plugin vs. validator

WPML and Polylang generate hreflang -- they're good at it. Hreflang Generator validates hreflang -- it's good at that. These tools aren't in competition. You use the plugin to generate the tags and the validator to confirm they're correct.

What the validator catches that plugins miss

Missing return links across templates

The validator checks that every language variant referenced in a page's hreflang cluster actually returns the link. Plugin configurations sometimes miss specific post types or custom templates.

Invalid language and region codes

WordPress locale codes (like en_US) are not the same as hreflang codes (en-US). Plugins handle this conversion -- but not always correctly. The validator confirms every code against the ISO standard.

Self-referencing tag verification

Every page must include a tag pointing to itself. The validator confirms this is present on every checked URL, including custom post types and template variants that plugins sometimes miss.

Canonical conflict detection

WordPress sites with multilingual plugins often have complex canonical configurations. The validator checks whether canonical and hreflang self-reference tags agree -- a common source of silent breakage.

Non-200 target URL detection

If your hreflang points to a URL that redirects or 404s -- perhaps a translated page that was deleted or a permalink structure that changed -- the validator flags it.

Validate what your WordPress plugin produces

Confirm your WPML or Polylang hreflang is actually correct. Free.

When to run validation

You don't need to validate every page every day. But there are specific moments when hreflang is most likely to drift or break on a WordPress site:

After plugin updates -- WPML and Polylang update regularly. Major version bumps occasionally change how hreflang is generated. Validate after any major plugin update.

After adding a new language -- When you add a new language to WPML or Polylang, existing pages need to be updated with the new hreflang variant. Validate a sample of existing pages after adding languages.

After template or theme changes -- If your theme or page templates are modified, the hreflang output can change. Validate key page types after any significant theme work.

After migrating to a new plugin -- If you're switching from WPML to Polylang or vice versa, validate the hreflang output after migration. The tag format and URL handling differs between plugins.

As part of an SEO audit -- If you're doing a full SEO audit of a multilingual WordPress site, hreflang validation should be on the checklist.

How it works in practice

1

Let your plugin generate hreflang as usual

Don't change your WPML or Polylang configuration. The plugin handles the generation -- that's what it's for.

2

Identify key page types to validate

Choose representative pages from your main post types: homepage, a standard page, a post, a custom post type if you have one, a taxonomy archive. These cover the different template contexts where hreflang is generated.

3

Run those URLs through the validator

The validator checks the live page's hreflang output for every requirement: return links, valid codes, self-references, canonical consistency, URL status codes.

4

Fix issues in the plugin configuration

If the validator finds errors, the fix usually lives in the plugin's language configuration, URL settings, or a missing translation assignment -- not in the hreflang tags directly. The tags are the output of the configuration.

5

Re-validate after fixes

After adjusting the plugin configuration, validate the affected pages again to confirm the hreflang output is now correct.

Plugin setups compared

Setuphreflang generationValidation included?Works with validator?
WPMLYes, automaticNoYes
PolylangYes, automaticNoYes
MultilingualPressYes, per-siteNoYes
Manual implementationYou write the tagsNoYes
Any setup + Hreflang GeneratorHandled by pluginYesYes

The pattern is the same regardless of which plugin you use. Generation is handled by the plugin. Validation is handled externally. Hreflang Generator fills that gap.

Free

$0

  • Up to 3 items
  • Email alerts
  • Basic support

Pro

$9/month

  • Unlimited items
  • Email + Slack alerts
  • Priority support
  • API access

Getting started

1

Make sure your multilingual plugin is configured

WPML or Polylang should be set up with your language variants and translations in place. The plugin handles hreflang generation -- you just need it configured correctly.

2

Run representative pages through the validator

Pick one page of each major template type and validate the live URL. You're looking for systematic errors that will affect all pages using that template.

3

Fix configuration-level issues

Most errors point to a plugin configuration issue, not a code problem. Adjust the language settings, URL structure configuration, or translation assignments as needed.

4

Add to your ongoing QA process

Validate hreflang after plugin updates, new language additions, and major site changes. It takes a few minutes and catches problems before they affect search visibility for months.


Part of Boring Tools -- boring tools for boring jobs.

Generate perfect hreflang tags

Create and validate hreflang markup for your multilingual site. Free.