Hreflang Tags Present
Issue No: 12
Category: International SEO
Issue type: Issue
Priority: IMPORTANT
Description
This audit verifies that pages declare alternate language or regional versions using hreflang tags so search engines can show the correct localized page to users.
How do we capture it
- When the xeopix crawler downloads the HTML response, the parser scans the
<head>section for all alternate hreflang declarations. - The crawler searches for hardcoded
hreflanglinks such as<link rel="alternate" hreflang="fr" href="https://example.com/fr/">inside the<head>. - The crawler extracts the hreflang language value, href URL, and source location.
- The crawler should also inspect HTTP
Link:headers and XML sitemap `xhtml:linka entries for hreflang declarations. - The crawler validates whether hreflang data exists, whether language codes follow ISO 639-1, whether regional values follow ISO 3166-1, and whether href values are valid URLs (because examples like
english,en_US,franceare invalid).
What to store
| Field | Type | Comment |
|---|---|---|
hreflang_tags | TEXT[] | Stores all hreflang lang + href objects |
hreflang_count | INT | Total hreflang tags detected |
invalid_lang_codes | TEXT[] | Invalid hreflang values |
hreflang_source | TEXT[] | Detection source (html/header/sitemap) |
has_hreflang_tags | BOOLEAN | Whether page contains hreflang implementation |
Condition for trigger
The crawler evaluates the stored hreflang fields against the following triggers:
-
Trigger Rule 1: Missing Hreflang Tags
-
Target Field:
hreflang_count -
Evaluation Logic:
= 0 -
Severity: WARNING
-
Diagnostic Message: "No hreflang tags were detected on this multilingual page. Search engines may serve incorrect language versions to users."
-
Trigger Rule 2: Invalid Hreflang Values
-
Target Field:
invalid_lang_codes -
Evaluation Logic:
length > 0 -
Severity: CRITICAL
-
Diagnostic Message: "Invalid hreflang language codes detected. Search engines may ignore these hreflang declarations."
Sources
- Google hreflang documentation: https://developers.google.com/search/docs/specialty/international/localized-versions
- Google multilingual site guide: https://developers.google.com/search/docs/specialty/international/managing-multi-regional-sites
- MDN rel alternate documentation: https://developers.mozilla.org/en-US/docs/Web/HTML/Attributes/rel
Long description
Hreflang tags help search engines understand which language or regional version of a page should be shown to users based on region. Missing or invalid hreflang implementation may cause incorrect regional pages appearing in search results, duplicate international pages competing against each other, lower international SEO relevance, and poor user experience for multilingual users. Google uses hreflang clusters to decide which country/language version to show, which version belongs together, and how to avoid duplicate international indexing.
Common failure scenarios:
- Missing Hreflang Completely: Google cannot determine language targeting.
- Invalid Language Code: (e.g. using
englishinstead ofen). - Broken Hreflang URLs: pointing to 404 pages, redirects, or blocked URLs.
How to Fix
Add hreflang tags inside page <head>:
<link rel="alternate" hreflang="en" href="https://site.com/en/">
<link rel="alternate" hreflang="fr" href="https://site.com/fr/">
Use ISO 639-1 language codes, valid URLs, and complete hreflang clusters for all language variants.