Hreflang Self-Referencing Tag (Each Page References Itself)
Issue No: 168
Category: International SEO
Issue type: Issue
Priority: IMPORTANT
Description
Every page that participates in an hreflang cluster must include a self-referencing hreflang tag pointing to its own URL. Google requires this for the hreflang set to be considered complete and valid.
How do we capture it
- Issue an HTTP GET to the target URL.
- Read the raw response and capture the final resolved URL (after any redirects).
- Parse the
<head>block of the raw HTML text for all<link rel="alternate" hreflang="...">tags. - Extract the
hrefattribute from every hreflang tag. - Compare each
hrefvalue against the page's own canonical URL (normalized: trailing slash, lowercase scheme/host). - Validate whether any hreflang tag's
hrefmatches the page's own canonical URL. - Verify that the matching hreflang tag's language code is a valid ISO 639-1 value or an ISO 639-1 + ISO 3166-1 pair.
- Flag the page as missing a self-reference if none of the hreflang
hrefvalues match the canonical page URL, or if only a relative URL is used. - Check whether the matching self-referencing
hrefis a fully qualified absolute URL. Setself_ref_href_is_absolute = FALSEif the value does not contain a scheme and host. - Compare the URL scheme of the self-referencing
hrefagainst the scheme of the crawled page URL. Setself_ref_scheme_matches_page = FALSEif they differ (e.g., self-referencing tag useshttpwhile the canonical page ishttps).
W1hat to store
| Field | Type | Comment |
|---|---|---|
has_self_referencing_hreflang | BOOLEAN | Whether the page includes a self-referencing hreflang tag |
self_ref_hreflang_lang | TEXT | The hreflang language code used in the self-referencing tag |
self_ref_hreflang_href | TEXT | The exact href value of the self-referencing tag |
hreflang_cluster_size | INTEGER | Total number of hreflang alternate tags found on the page |
self_ref_href_is_absolute | BOOLEAN | Whether the self-referencing hreflang href is a fully qualified absolute URL |
self_ref_scheme_matches_page | BOOLEAN | Whether the URL scheme of the self-referencing href matches the crawled page URL scheme |
Condition for trigger
The following trigger rules evaluate hreflang self-referencing compliance:
-
Trigger Rule 1: Missing Self-Referencing Hreflang Tag
- Target Field:
has_self_referencing_hreflang - Evaluation Logic:
= FALSE - Severity: CRITICAL
- Diagnostic Message: "This page does not include a self-referencing hreflang tag. Google requires each page in an hreflang cluster to reference itself. The hreflang set may be ignored."
- Target Field:
-
Trigger Rule 2: Hreflang Tags Present But No Cluster
- Target Field:
hreflang_cluster_size - Evaluation Logic:
= 1 - Severity: WARNING
- Diagnostic Message: "Only one hreflang tag was found on this page. A valid hreflang cluster requires at least a self-referencing tag and one or more alternate language tags. Isolated hreflang tags may not be processed by search engines."
- Target Field:
-
Trigger Rule 3: Self-Referencing Hreflang Href Is Not Absolute
- Target Field:
self_ref_href_is_absolute - Evaluation Logic:
= FALSE AND has_self_referencing_hreflang = TRUE - Severity: WARNING
- Diagnostic Message: "The self-referencing hreflang href is not a fully qualified absolute URL. Google requires all hreflang href values to be absolute URLs including scheme and host."
- Target Field:
-
Trigger Rule 4: Self-Referencing Hreflang Scheme Mismatch
- Target Field:
self_ref_scheme_matches_page - Evaluation Logic:
= FALSE AND has_self_referencing_hreflang = TRUE - Severity: WARNING
- Diagnostic Message: "The URL scheme of the self-referencing hreflang href does not match the crawled page URL scheme. Using
httpin the self-referencing tag when the canonical page is served overhttpsmay cause the cluster to be treated as mismatched."
- Target Field:
Sources
- Google hreflang documentation — self-referencing requirement: https://developers.google.com/search/docs/specialty/international/localized-versions#all-pages-in-cluster
- Google multilingual site management: https://developers.google.com/search/docs/specialty/international/managing-multi-regional-sites
- MDN rel=alternate: https://developer.mozilla.org/en-US/docs/Web/HTML/Attributes/rel
Long description
Google's hreflang specification requires that every page in a hreflang cluster include a self-referencing hreflang tag — a tag whose href points back to the page itself. This signals to Google that the page is aware of its own place in the internationalized cluster.
Without a self-referencing tag:
- Google may treat the hreflang cluster as incomplete.
- The page may not be included in hreflang matching logic.
- Wrong language versions may be served to international users.
Common problems:
- Page declares alternates for other locales but omits a tag for itself.
- Self-referencing tag uses a non-canonical URL variant.
- Hreflang tags are added only on the homepage and not on all language variants.
- The self-reference uses an HTTP instead of HTTPS canonical URL.
How to Fix
Every language page must include its own self-referencing hreflang tag. To resolve the issue:
- Ensure every language variant page references itself.
- Use the exact absolute canonical URL (e.g. including HTTPS and correctly handling trailing slashes).
- Include all alternate language tags on every page in the cluster, not just the homepage.