What does 'Invalid Hreflang Region Code' mean in Site Audit?
Invalid Hreflang Region Code
Description
The page contains hreflang tags with invalid region codes.
How to Fix
Update the hreflang tags to use valid ISO 3166-1 Alpha-2 region codes.
Detailed Analysis
-
What Causes This Issue:
The "Invalid Hreflang Region Code" issue arises when the hreflang attribute on a webpage uses incorrect or non-standard region codes. Hreflang tags are used to inform search engines about the language and geographic targeting of a webpage. They consist of a language code and optionally, a region code. The issue occurs when:
- The region code is not a valid ISO 3166-1 alpha-2 country code.
- The region code is incorrectly formatted or misspelled.
- The language code is used with an invalid or unnecessary region code.
-
Why It's Important:
Correct hreflang implementation is crucial for SEO as it helps search engines serve the correct regional or language version of a webpage to the appropriate audience. Invalid hreflang region codes can lead to:
- Search engines ignoring hreflang annotations, leading to improper indexing and ranking of pages.
- Poor user experience as users may be directed to a page in the wrong language or for the wrong region.
- Potential loss of traffic and revenue if users are not served content in their preferred language or regional variation.
- Wasted crawl budget as search engines attempt to understand the incorrect hreflang tags.
-
Best Practices to Prevent It:
- Use Valid ISO Codes: Ensure both language and region codes comply with ISO standards. Language codes should follow ISO 639-1 and region codes should follow ISO 3166-1 alpha-2.
- Consistency: Maintain consistency in the use of hreflang tags across all versions of your website. Every alternate version should link back to its counterparts.
- Correct Syntax: Use the correct syntax for hreflang attributes,
hreflang="language-region"
, where both parts are separated by a hyphen. - Testing and Validation: Regularly validate your hreflang tags using tools like Google Search Console, Screaming Frog, or other SEO auditing tools to identify and correct issues.
- Avoid Redundancy: Only use region codes when necessary. For example, use
en
for a general English page, anden-US
only if targeting U.S. English specifically.
-
Examples of Good and Bad Cases:
Bad Case Examples:
<link rel="alternate" hreflang="en-US-CA" href="http://example.com/us/">
- Incorrect use of triple region/language code.
<link rel="alternate" hreflang="en-UK" href="http://example.com/uk/">
- Incorrect region code; should be
GB
instead ofUK
.
- Incorrect region code; should be
Good Case Examples:
<link rel="alternate" hreflang="en" href="http://example.com/">
- Correct use for a general English page without specific regional targeting.
<link rel="alternate" hreflang="en-US" href="http://example.com/us/">
- Correct use for targeting English-speaking users in the United States.
<link rel="alternate" hreflang="fr-CA" href="http://example.com/ca-fr/">
- Correct use for targeting French-speaking users in Canada.
By adhering to these best practices and ensuring the correct implementation of hreflang tags, you can optimize your website's international SEO strategy and ensure a better user experience across different regions and languages.
Updated about 5 hours ago