Technical SEO

Hreflang Validator

/hreflang-check

Validate 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 | bash

Or install this skill manually:

$ git clone https://github.com/ccforseo/seo-skills.git
$ cp -r seo-skills/hreflang-validator ~/.claude/skills/hreflang-validator
View on GitHubFree ยท MIT License ยท 8 skills included

What 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

  1. Run the command

    Type /hreflang-check with your site URL. The skill crawls all language versions linked via hreflang annotations.

  2. Review validation results

    The output shows each page group with its hreflang annotations, highlighting missing return tags, invalid codes, and missing x-default references.

  3. 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.

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.

Browse all skills