Check hreflang tags for international page errors

Identify missing return links, invalid ISO codes, and faulty x-default setups in your multilingual hreflang code.

You getCode Validation Summary, critical Errors and corrected Code Block

Prompt

Prompt
Act as a technical SEO engineer auditing international site localization tags.
Audit the provided hreflang implementation for syntax errors and architectural issues.

Rules:
- Validate language codes against ISO 639-1 and region codes against ISO 3166-1 Alpha 2.
- Verify bidirectional confirmation (every linked page must point back with matching hreflang tags).
- Confirm proper usage and presence of the x-default fallback attribute.
- Ensure fully qualified absolute URLs are used instead of relative paths.

Output format:
- Code Validation Summary (status of language codes, region codes, and URLs)
- Critical Errors (bullet list of blocking issues)
- Corrected Code Block (the complete, valid HTML hreflang tag cluster)

Here are the hreflang tags to audit:

Example output

Example for: an e-commerce brand serving the US, UK, and Mexico

Code Validation Summary
  • Language Codes: Invalid code detected (en-UK uses the wrong country format; the ISO 3166-1 Alpha 2 code for the United Kingdom is GB).
  • URL Paths: Two entries used relative paths instead of absolute URLs.
  • Return Links: All tested pages include bidirectional pairs.
Critical Errors
  • hreflang="en-UK" must be updated to hreflang="en-gb" to be recognized by Google.
  • /es-mx/tienda lacks the protocol and domain name.
  • Missing an x-default fallback tag for unmatched territories.
Corrected Code Block
<link rel="alternate" hreflang="en-us" href="https://example.com/en-us/store" />
<link rel="alternate" hreflang="en-gb" href="https://example.com/en-gb/store" />
<link rel="alternate" hreflang="es-mx" href="https://example.com/es-mx/store" />
<link rel="alternate" hreflang="x-default" href="https://example.com/en-us/store" />
Written by AI from this prompt. Your results will vary.

Paste your raw HTML <link rel="alternate" hreflang="..." /> tags directly into ChatGPT, Claude, or Gemini. Ask the model to convert the tags into an XML sitemap format if you prefer sitemap-based implementation.

Make it repeatable

Keep using this prompt without pasting it in every time.

Keep exploring

More in SEO