$npx -y skills add AgriciDaniel/claude-seo --skill seo-hreflangHreflang and international SEO audit, validation, and generation. Detects common mistakes, validates language/region codes, and generates correct hreflang implementations. Use when user says "hreflang", "i18n SEO", "international SEO", "multi-language", "multi-region", or "langua
| 1 | # Hreflang & International SEO |
| 2 | |
| 3 | Validate existing hreflang implementations or generate correct hreflang tags |
| 4 | for multi-language and multi-region sites. Supports HTML, HTTP header, and |
| 5 | XML sitemap implementations. |
| 6 | |
| 7 | ## Validation Checks |
| 8 | |
| 9 | ### 1. Self-Referencing Tags |
| 10 | - Every page must include an hreflang tag pointing to itself |
| 11 | - The self-referencing URL must exactly match the page's canonical URL |
| 12 | - Missing self-referencing tags cause Google to ignore the entire hreflang set |
| 13 | |
| 14 | ### 2. Return Tags |
| 15 | - If page A links to page B with hreflang, page B must link back to page A |
| 16 | - Every hreflang relationship must be bidirectional (A→B and B→A) |
| 17 | - Missing return tags invalidate the hreflang signal for both pages |
| 18 | - Check all language versions reference each other (full mesh) |
| 19 | |
| 20 | ### 3. x-default Tag |
| 21 | - Recommended when a selector/fallback URL exists: designates the fallback page for unmatched languages/regions |
| 22 | - Typically points to the language selector page or English version |
| 23 | - Only one x-default per set of alternates |
| 24 | - Must also have return tags from all other language versions |
| 25 | |
| 26 | ### 4. Language Code Validation |
| 27 | - Must use ISO 639-1 two-letter codes (e.g., `en`, `fr`, `de`, `ja`) |
| 28 | - An **optional ISO 15924 script subtag** is the documented, official mechanism |
| 29 | for script: `zh-Hant` (Traditional) / `zh-Hans` (Simplified). Script may |
| 30 | combine with a region, e.g. `zh-Hans-US` is valid (language + script + region). |
| 31 | - Common errors: |
| 32 | - `eng` instead of `en` (ISO 639-2, not valid for hreflang) |
| 33 | - `jp` instead of `ja` (incorrect code for Japanese) |
| 34 | - `zh` is valid but ambiguous for script-specific pages; prefer `zh-Hans` or `zh-Hant` when targeting a script |
| 35 | |
| 36 | ### 5. Region Code Validation |
| 37 | - Optional region qualifier uses ISO 3166-1 Alpha-2 (e.g., `en-US`, `en-GB`, `pt-BR`) |
| 38 | - Format: `language-REGION` (lowercase language, uppercase region) |
| 39 | - A **country code alone is invalid**, you cannot specify a region without a |
| 40 | language (Google's own bad example is `be`, which is actually the Belarusian |
| 41 | *language* code, not Belgium). |
| 42 | - Common errors: |
| 43 | - `en-uk` instead of `en-GB` (UK is not a valid ISO 3166-1 region code) |
| 44 | - `EU` / `UN` as a region (not valid ISO 3166-1 values) |
| 45 | - `es-LA` (Latin America is not a country; use specific countries) |
| 46 | - Region without language prefix |
| 47 | |
| 48 | ### 5b. Geo-targeting signal hierarchy |
| 49 | - Practical locale-signal heuristic: **ccTLD > hreflang annotations > |
| 50 | server location/IP > addresses/language/currency/Business Profile**. Do not |
| 51 | present this as a confirmed Google ranking order. hreflang is a |
| 52 | **hint, not a directive**. Google **ignores** locational meta tags and |
| 53 | HTML geotargeting attributes. |
| 54 | - The Search Console **International Targeting report and the manual |
| 55 | country-targeting setting were removed in 2022**, do **not** recommend setting |
| 56 | country targeting in GSC; hreflang is the remaining lever. |
| 57 | |
| 58 | ### 6. Canonical URL Alignment |
| 59 | - Hreflang tags must only appear on canonical URLs |
| 60 | - If a page has `rel=canonical` pointing elsewhere, hreflang on that page is ignored |
| 61 | - The canonical URL and hreflang URL must match exactly (including trailing slashes) |
| 62 | - Non-canonical pages should not be in any hreflang set |
| 63 | |
| 64 | ### 7. Protocol Consistency |
| 65 | - All URLs in an hreflang set must use the same protocol (HTTPS or HTTP) |
| 66 | - Mixed HTTP/HTTPS in hreflang sets causes validation failures |
| 67 | - After HTTPS migration, update all hreflang tags to HTTPS |
| 68 | |
| 69 | ### 8. Cross-Domain Support |
| 70 | - Hreflang works across different domains (e.g., example.com and example.de) |
| 71 | - Cross-domain hreflang requires return tags on both domains |
| 72 | - Use Google Search Console verification for monitoring or cross-site sitemap submission when needed |
| 73 | - Sitemap-based implementation recommended for cross-domain setups |
| 74 | |
| 75 | ## Common Mistakes |
| 76 | |
| 77 | | Issue | Severity | Fix | |
| 78 | |-------|----------|-----| |
| 79 | | Missing self-referencing tag | Critical | Add hreflang pointing to same page URL | |
| 80 | | Missing return tags (A→B but no B→A) | Critical | Add matching return tags on all alternates | |
| 81 | | Missing x-default when fallback behavior is required | Medium | Add x-default pointing to fallback/selector page | |
| 82 | | Invalid language code (e.g., `eng`) | High | Use ISO 639-1 two-letter codes | |
| 83 | | Invalid region code (e.g., `en-uk`) | High | Use ISO 3166-1 Alpha-2 codes | |
| 84 | | Hreflang on non-canonical URL | High | Move hreflang to canonical URL only | |
| 85 | | HTTP/HTTPS mismatch in URLs | Medium | Standardize all URLs to HTTPS | |
| 86 | | Trailing slash inconsistency | Medium | Match canonical URL format exactly | |
| 87 | | Hreflang in both HTML and sitemap | Low | Ch |