WordPress & multilingual sites
Hreflang Tags and Multilingual SEO: URL Structures, x-default and Common Mistakes
Hreflang tells Google which language version to show to whom, but only when it is reciprocal and consistent. Learn URL structures, x-default and the mistakes that break it.
By AYM FlowPublished: Updated: 5 min read
A multilingual site can double or triple your reach, or it can fill Google's index with duplicate pages shown to the wrong audience. The difference is mostly technical: clean URLs per language, correct hreflang tags and genuinely translated metadata. This guide covers the decisions and the errors we see most often when auditing international sites.
What hreflang does, and what it does not
Hreflang annotations tell search engines that several URLs are alternates of the same content in different languages or regions, so the right version can be shown to the right searcher. They are a signal, not a directive, and they do not boost rankings by themselves or replace translation. Google's documentation on localized versions of your pages is the authoritative reference, and it is worth reading once in full.
Choose a URL structure
Each language needs its own crawlable URL. Cookies, session state or browser-language detection that swap content on one URL do not work, because Googlebot sees only one version. The three accepted structures are:
- Subdirectories such as example.com/de/. One domain accumulates authority, setup is simple and it is the best default for most businesses.
- Subdomains such as de.example.com. Easier to host separately, but treated more like separate sites, so authority is shared less directly.
- Country-code domains such as example.de. The strongest geo-targeting signal and local trust, but the highest cost and the most work to maintain.
Google compares these options in its guide to managing multi-regional and multilingual sites. Whatever you pick, stay consistent and avoid URL parameters for language.
Write hreflang tags correctly
You can place annotations in the HTML head, in HTTP headers for non-HTML files, or in the XML sitemap. Use one method consistently. The rules that matter:
- Reciprocal tags. If page A lists page B as an alternate, page B must list page A. Without return links the annotations may be ignored.
- Self-reference. Every page includes a tag pointing to itself, alongside its alternates.
- Valid codes. Use ISO 639-1 language codes, optionally followed by an ISO 3166-1 region, for example en, en-GB, pt-BR or de-AT. A region on its own is invalid.
- Absolute URLs. Use the full canonical URL, including protocol.
- x-default. Add one x-default entry pointing to the fallback page, typically a language selector or your main language, for users whose language you do not serve.
- Match canonicals. Each URL in a hreflang set should be the canonical of its own page.
Hreflang pairs are per page, not per site. A translated blog post links only to its own translation, never to the homepage of another language.
Example: a complete hreflang set
Every language version carries the same full set of annotations, including a line pointing to itself, plus a self-referencing canonical. The x-default line names the version for users whose language you do not serve.
<!-- In the <head> of the Turkish page. Every language version prints the same alternate set. -->
<link rel="canonical" href="https://example.com/tr/hizmetler" />
<link rel="alternate" hreflang="en" href="https://example.com/services" />
<link rel="alternate" hreflang="tr" href="https://example.com/tr/hizmetler" />
<link rel="alternate" hreflang="de" href="https://example.com/de/dienstleistungen" />
<link rel="alternate" hreflang="x-default" href="https://example.com/services" />The block above is what the Turkish page of a three-language site prints; the English and German pages print the same alternate lines and only change their canonical. If a page is missing from the set, or a version points to a URL that redirects, search engines may ignore the annotations for that group.
Common mistakes that break multilingual SEO
- Missing return tags, the most frequent error, often caused by publishing a page in one language only.
- Pointing hreflang to redirected, noindex or 404 URLs, which invalidates the set.
- Canonicalising every language to the main language, which tells Google the translations are duplicates to ignore.
- Using wrong codes, such as en-UK instead of en-GB, or country codes where language codes belong.
- Redirecting visitors by IP address automatically. Crawlers cannot follow it, and users get trapped. Suggest a language with a banner instead and keep every URL reachable.
- Machine translation published unreviewed, which creates thin or awkward pages that underperform and hurt trust.
- Mixing methods, such as head tags that disagree with the sitemap.
Translate everything that ranks
Hreflang is only the plumbing. For each language, translate the title tag, meta description, headings, image alt text, URL slugs where sensible, internal anchor text and structured data, and localise currency, units and contact details. Include language alternates in the sitemap, link the language switcher with real anchor links and keep the same internal linking depth across languages. Then verify in Search Console, which reports each language version in the Pages and Performance reports.
If you are relaunching a site as part of this work, combine it with our website migration SEO checklist so redirects and hreflang are planned together.
Audit and test your hreflang
Hreflang errors are silent: nothing breaks visibly, the wrong page simply ranks in the wrong country. Build an audit routine instead of trusting that the setup worked.
- Crawl the site with a crawler that validates hreflang and review the reports for missing return links, non-canonical targets and invalid codes.
- Spot-check ten representative pages by viewing the source in each language and confirming that every alternate, the self-reference and x-default are present.
- In Search Console, compare impressions by country and language, and check the Pages report for translated URLs that are excluded or marked as duplicates.
- Search for a distinctive phrase from a translated page in the target language and country, and confirm the right version appears.
- Re-run the audit after every theme, plugin or URL structure change, and after adding a new language.
If you use the sitemap method, remember that each URL entry must list all of its alternates, including itself, and that large sites should split sitemaps by language to keep files manageable. Whichever method you choose, generate the annotations from the same source of truth as your language switcher, so they cannot drift apart.
Doing it properly in WordPress
WordPress has no built-in multilingual layer, so the plugin you choose decides how clean the output is. AYM Multilingual gives each language its own URL, outputs reciprocal hreflang with a self-reference and an x-default, translates titles, descriptions and menus, and works with Elementor, WPBakery, Divi, Gutenberg and WooCommerce. The free Lite plan covers two languages, and paid plans on the pricing page add unlimited languages and AI-assisted translation that you review before publishing.
Our multilingual WordPress service covers setup, migration from WPML or Polylang, and an audit of existing hreflang output, backed by our wider SEO service. If your international rollout is stuck, send us the domain and we will tell you what is broken.
Frequently asked questions
Do I need hreflang if my site has only one language?
No. Hreflang is for sites with multiple language or regional versions of the same content. A single-language site does not need it.
What is x-default in hreflang?
x-default marks the fallback URL for users whose language or region is not covered by your other versions, usually a language selector page or your main-language page.
Which URL structure is best for multilingual SEO?
Subdirectories are the best default for most businesses because they consolidate authority and are simple to run. Country-code domains make sense when you need strong local targeting and can maintain separate sites.
Can I use machine translation for multilingual SEO?
As a first draft, yes. Publish only after human review, since unreviewed output tends to read poorly and can create thin pages that perform badly.
Related articles
WordPress & multilingual sites
Localization vs Translation: The Difference and How to Apply It to Your Website
Translation moves text into another language; localization rebuilds the site for someone living in that market. We explain the difference with examples from our own keyword research.
WordPress & multilingual sites
Add a Language to a WordPress Site: A Step-by-Step Guide
You want to add English or another language to your existing WordPress site. The “Site Language” setting is not enough; here is how to do it with the right structure, priorities and SEO steps.
WordPress & multilingual sites
Language Switcher Design: User-Friendly, Accessible and SEO-Safe
Flags or language names? Top-right corner or footer? The principles of a language switcher that visitors can find, use with a keyboard and that search engines understand.
