Hreflang checker

Check hreflang on a single URL, or across a whole set of pages: language and region codes, self reference, duplicates, x-default, return links, and alternates that redirect, fail or carry noindex.

What it does

Across the whole set

Return links and confirmation need every page of the set, because they compare what page A says about page B with what page B says back. These checks run on set-wide crawl data, not on one page. They also look at the alternate targets: whether each one answers 200, is indexable and is its own canonical.

  • Missing return links and unconfirmed pairs
  • Alternates that redirect, return 4xx or 5xx, or carry noindex
  • Alternates that are not the canonical version of the page
  • Alternates that no internal link points to

Single URL

hreflang-check fetches one page, follows redirects and reads the alternate links in its HTML. It validates every language, script and region code, spots duplicate values, and checks that the page lists itself and that an x-default exists. It does not request the alternates, so it is a quick first look before you run a full crawl.

  • Language, script and region codes checked against ISO 639-1, ISO 15924 and ISO 3166-1
  • Self reference and duplicate values
  • x-default presence
  • A 4xx or 5xx page is reported as an error, not as a clean result

Placement

An hreflang link only counts if the parser reads it inside the head. A native crawl compares the position of every alternate link, and flags the ones that end up in the body, often because of a broken tag above them in the head. Fixing that tag fixes the annotation.

  • Alternate links outside the head are reported
  • Case does not matter: en-us and en-US are the same value
  • Common mistakes such as en-UK are caught

Three steps, one saved scan

  1. Check one URL live

    hreflang-check fetches the page, follows redirects and reads the alternate links in its HTML. It checks codes, self-reference, duplicates and x-default.

  2. Check the set across a crawl

    Return links, broken or redirecting targets and noindex targets need every page in the set. They run across the whole native crawl — or an imported All Hreflang export via spiderhead sf run — not on one page.

  3. Fix the pairs and re-check

    Each finding names the page and the alternate it concerns. Correct the annotation on the site, then run the check again.

Checks in this feature

CheckWhat it meansSeverityEvidence
HREFLANG_MISSING_RETURN_LINKAnother page names this URL in its hreflang, but this page does not point backImportantSource page and the alternate that lacks the reciprocal link (crawl)
HREFLANG_BROKEN_TARGETAn alternate URL answers with a 3xx, 4xx or 5xx statusImportantTarget URL and its status code (crawl)
HREFLANG_NOINDEX_TARGETAn alternate URL carries a noindex directiveImportantTarget URL and the noindex signal (crawl)
HREFLANG_INVALID_CODEA language or region value is not a valid ISO 639-1, ISO 15924 or ISO 3166-1 code, for example en-UKImportantThe raw hreflang value and the page it sits on (single URL: 'malformed hreflang code')
HREFLANG_MISSING_SELF_REFERENCEThe page has alternates but none of them is its own URLImportantThe page URL and its alternate list (single URL: 'page does not self-reference')
HREFLANG_MULTIPLE_ENTRIESThe same language and region value appears more than once on one pageImportantThe repeated value and its hrefs (single URL: 'duplicate hreflang')
HREFLANG_MISSING_XDEFAULTThe set has no x-default fallback for users whose language matches no alternateTipThe page and its alternate list (single URL: 'no x-default alternate')
Also in the check registry
HREFLANG_ERRORHREFLANG_INCONSISTENT_CONFIRMATIONHREFLANG_NOT_CANONICALHREFLANG_UNLINKED_TARGETHREFLANG_OUTSIDE_HEAD

One command

bash
spiderhead hreflang-check --url https://example.com/en/

Install first: installation guide. Every command also runs as an MCP tool for AI agents.

What you need

  • One page URL for hreflang-check
  • A crawl or an external crawler All Hreflang export for the set-wide checks
  • No API keys

Limits

  • The single-URL check does not request the alternates, so it cannot see their status codes, noindex or return links
  • It reads link elements in the HTML only, not hreflang in sitemaps or HTTP Link headers
  • Set-wide checks are documented against external crawler hreflang exports; a native scan does not retain hreflang data
  • A valid code does not prove the page is in that language

Questions

Does the single-URL check test every alternate?
No. It reads the page's own alternate links and checks their codes, duplicates, x-default and the page's self-reference. It does not request each alternate, so broken, redirecting or noindex targets and missing return links need a crawl.
Does it change anything on my site?
No. The check sends read-only GET requests. Nothing is written to the site.
Which language codes count as valid?
A language code from ISO 639-1, optionally followed by a script from ISO 15924, then a region from ISO 3166-1 alpha-2 or UN M.49. Codes are case-insensitive, so en-us and en-US are the same value. en-UK is rejected, because the country code is GB.
Does it read hreflang from sitemaps or HTTP headers?
The single-URL check reads only the link elements in the HTML response. Hreflang declared in a sitemap or an HTTP Link header is not read by this command.
What happens if the page returns an error?
The check reports the HTTP status and says there were no annotations to check. A 4xx or 5xx page never shows as a clean result.
Is a missing x-default an error?
It is the mildest finding. x-default is a fallback for users whose language matches no alternate. It is useful, but not required, so the registry rates it as a notice, below the problems that break the annotation.

Try it on your own site