Skip to content

Everything for WordPress, web development — and beyond

hreflang generator and audit

hreflang generator and validator for a multilingual site

Build correct alternate language version tags — in HTML, in a sitemap or as a PHP snippet. The second tab checks existing tags for errors that show no symptom other than a drop in traffic. Works offline: suitable for staging and password-protected sites.

Preset
The second subtag is the country of the audience, not the country of the language. For a site operating in Ukraine, the Russian version should be ru-UA, not ru-RU: ru-RU tells Google that the page is meant for users in Russia. Almost every generator inserts exactly ru-RU — and that is a silent loss of traffic.
Language Region Version URL x-default
Settings
One of the three methods is enough. Using both the tags and the sitemap is not a mistake, but it does not double the effect either.
Fill in at least two language versions to see the code.

Neither the URL nor the pasted code leaves your browser — both the generation and the audit run locally.

Two thirds of sites with hreflang contain errors

According to an Ahrefs study of 374,756 domains, 67% of sites with hreflang have configured it incorrectly. The most common problems: 56% have no x-default, on 18% the page does not link to itself, 15% have no return links. The rules are simple, but easy to break. Every language version must list ALL versions, itself included. If page A points to B, then B is obliged to point to A — otherwise Google ignores the relationship entirely. x-default marks the version for visitors whose language matches none of the available ones. One trap concerns us directly: uk is the code of the Ukrainian LANGUAGE. The country code for the United Kingdom is GB, while UK is assigned to Ukraine in the ISO 3166 standard. That is why en-UK is almost always a mistake — en-GB was meant. It is the most common error worldwide. And a second one, purely ours: for a Ukrainian site with a Russian version the correct pair is uk-UA and ru-UA. That is, the Russian language targeted at Ukraine, not ru-RU. No English-language generator hints at this, because to it this is exotica.

Frequently asked questions