Skip to main content

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

  1. When the xeopix crawler downloads the HTML response, the parser scans the <head> section for all alternate hreflang declarations.
  2. The crawler searches for hardcoded hreflang links such as <link rel="alternate" hreflang="fr" href="https://example.com/fr/"> inside the <head>.
  3. The crawler extracts the hreflang language value, href URL, and source location.
  4. The crawler should also inspect HTTP Link: headers and XML sitemap `xhtml:linka entries for hreflang declarations.
  5. 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, france are invalid).

What to store

FieldTypeComment
hreflang_tagsTEXT[]Stores all hreflang lang + href objects
hreflang_countINTTotal hreflang tags detected
invalid_lang_codesTEXT[]Invalid hreflang values
hreflang_sourceTEXT[]Detection source (html/header/sitemap)
has_hreflang_tagsBOOLEANWhether 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

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 english instead of en).
  • 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.