Hreflang / International SEO
Validate the hreflang alternate-link signals on a page.
Procedure
Fetch and parse the page, then run the hreflang check:
python -m seo_kit.technical.hreflang "<url>"or from Python:
from seo_kit.crawler.page_fetcher import fetch_page, parse_html from seo_kit.technical.hreflang import run_hreflang_check _, html, _, _ = fetch_page("<url>") page = parse_html(html, "<url>") result = run_hreflang_check(page) print(result.to_dict())Report:
- Whether any hreflang/alternate links exist at all
- Malformed or duplicate language-region codes
- Whether
x-defaultis declared - A score (0-100) with findings
Recommend fixes:
- No hreflang on a multi-language site → add
<link rel="alternate">per locale. - Missing
x-default→ addhreflang="x-default"for the primary version. - Invalid codes → correct to ISO 639-1 (
en,en-gb,de,fr-ca, ...).
- No hreflang on a multi-language site → add
Notes
- Detected via
<link rel="alternate" hreflang="...">in the page<head>. - Inspired by AgriciDaniel/claude-seo and seranking/seo-skills (both MIT).