Hreflang Validator
/hreflang-checkValidate hreflang implementation across your multilingual site. Detects missing return tags, incorrect language codes, and x-default issues.
Get this skill
Install all free SEO skills with one command:
curl -fsSL https://raw.githubusercontent.com/ccforseo/seo-skills/main/install.sh | bashOr install this skill manually:
$ git clone https://github.com/ccforseo/seo-skills.git
$ cp -r seo-skills/hreflang-validator ~/.claude/skills/hreflang-validatorWhat it does
The Hreflang Validator skill checks every hreflang annotation on your site for correctness. It crawls all language versions of each page, verifies bidirectional return tags, validates ISO 639-1 language codes and ISO 3166-1 region codes, and confirms x-default tags exist. It catches the most common hreflang errors that cause wrong-language pages to rank in local results.
Key features
- Validates bidirectional return tags across all language versions
- Checks ISO 639-1 language and ISO 3166-1 region codes
- Verifies x-default tag presence and correctness
- Detects self-referencing hreflang tag issues
- Flags conflicting hreflang annotations across HTML and sitemaps
How to use Hreflang Validator
Run the command
Type /hreflang-check with your site URL. The skill crawls all language versions linked via hreflang annotations.
Review validation results
The output shows each page group with its hreflang annotations, highlighting missing return tags, invalid codes, and missing x-default references.
Fix the issues
Update your hreflang tags to ensure every annotation has a matching return tag on the target page. The skill lists exactly which tags need adding or correcting.
When to use it
Validating hreflang after launching new language versions
Debugging international SEO issues where wrong pages rank
Pre-migration check for multilingual site restructures
Quarterly audit of hreflang consistency
Frequently asked questions
What is a missing return tag in hreflang?
If page A declares a hreflang pointing to page B, page B must also declare a hreflang pointing back to page A. A missing return tag means this bidirectional link is broken, which can cause Google to ignore both annotations.
Do I need an x-default hreflang tag?
Google recommends x-default for specifying the fallback page when no language/region matches the user. While not strictly required, it prevents unwanted redirects and ensures a predictable experience for users outside your targeted regions.
Can I use hreflang in both HTML and XML sitemaps?
Yes, but they must be consistent. The skill checks for conflicts between hreflang annotations in HTML link elements and XML sitemap entries. Mismatches between the two implementations confuse search engines.
Does hreflang affect rankings?
Hreflang does not directly boost rankings, but it ensures the correct language version of your page appears in each market's search results. Incorrect hreflang causes the wrong page to rank, splitting traffic and hurting conversion rates.
Related skills
Site Audit
/seo-auditRun a full technical SEO audit from your terminal. Checks crawlability, indexation issues, meta tags, page speed signals, and site structure in one pass.
Technical SEOSitemap Auditor
/sitemap-auditValidate your XML sitemap for errors, missing pages, and inconsistencies. Checks lastmod dates, priorities, URL counts, and cross-references against actual crawlable pages.
Technical SEORobots.txt Generator
/robots-genGenerate and validate robots.txt files for your site. Handles multi-bot rules, crawl-delay directives, and sitemap declarations.
Technical SEOStructured Data Validator
/sd-validateValidate JSON-LD structured data on any page against schema.org specs and Google's rich result requirements. Catches errors before they cost you rich snippets.
Get all 50 skills
The SEO Command Center includes every skill in this library plus Python data fetchers, CLAUDE.md configs, and report templates. One-time purchase.