# SEO Hreflang

> Validate hreflang / international SEO tags — language-region codes, duplicates, and x-default. Use when the user asks about hreflang, international SEO, multi-language or multi-region sites.

- Skill: `freeautomation-tech/seo-hreflang` (Agent Skill)
- Install (CLI): `npx skillmds@latest add freeautomation-tech/seo-hreflang`
- Raw SKILL.md: https://api.skillmd.com/api/skills/freeautomation-tech/seo-hreflang/raw
- Safety review: pending
- Works with: Claude Code, Claude.ai, OpenAI Codex
- Category: Marketing & Growth
- Author: FreeAutomation-Tech (https://skillmd.com/u/freeautomation-tech)
- Updated: 2026-09-17
- Page: https://skillmd.com/skills/freeautomation-tech/seo-hreflang

---


# Hreflang / International SEO

Validate the `hreflang` alternate-link signals on a page.

## Procedure

1. **Fetch and parse the page**, then run the hreflang check:

   ```bash
   python -m seo_kit.technical.hreflang "<url>"
   ```

   or from Python:

   ```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())
   ```

2. **Report:**
   - Whether any hreflang/alternate links exist at all
   - Malformed or duplicate language-region codes
   - Whether `x-default` is declared
   - A score (0-100) with findings

3. **Recommend fixes:**
   - No hreflang on a multi-language site → add `<link rel="alternate">` per locale.
   - Missing `x-default` → add `hreflang="x-default"` for the primary version.
   - Invalid codes → correct to ISO 639-1 (`en`, `en-gb`, `de`, `fr-ca`, ...).

## Notes

- Detected via `<link rel="alternate" hreflang="...">` in the page `<head>`.
- Inspired by [AgriciDaniel/claude-seo](https://github.com/AgriciDaniel/claude-seo)
  and [seranking/seo-skills](https://github.com/seranking/seo-skills) (both MIT).

