---
title: Invalid Order of Hreflang Values
description: If country code precedes language code in an hreflang attribute, it's not valid. Learn how to fix this issue both manually and at scale.
---

[Knowledge Base - Resources - seoClarity ](https://www.seoclarity.net/resources/knowledgebase)

# [Invalid Order of Hreflang Values](https://www.seoclarity.net/resources/knowledgebase/glossary/hreflang/invalid-order-hreflang-values)

 Written by [Suraj Lalchandani](https://www.seoclarity.net/resources/knowledgebase/author/suraj-lalchandani) | May 4, 2023

The language code must precede the country code to have a valid [hreflang attribute](https://www.seoclarity.net/resources/knowledgebase/glossary/hreflang). If your order is invalid, you can update the hreflang to swap the order and resolve this issue. 

Here’s an example to visualize the issue:

**Correct:** hreflang=“en-us”

**Incorrect: **hreflang=“us-en”

#### Table of Contents

- - [Why Order Matters in Hreflang](https://www.seoclarity.net/resources/knowledgebase/glossary/hreflang/invalid-order-hreflang-values?hs_amp=true#why-order-metters-hreflang)
    - [Updating Hreflang Values](https://www.seoclarity.net/resources/knowledgebase/glossary/hreflang/invalid-order-hreflang-values?hs_amp=true#updating-hreflang-values)
    - [Updating Hreflang Values at Scale](https://www.seoclarity.net/resources/knowledgebase/glossary/hreflang/invalid-order-hreflang-values?hs_amp=true#updating-hreflang-values-scale)
      
          - [Before and After](https://www.seoclarity.net/resources/knowledgebase/glossary/hreflang/invalid-order-hreflang-values?hs_amp=true#before-after)
    - [Looking for other hreflang issues?](https://www.seoclarity.net/resources/knowledgebase/glossary/hreflang/invalid-order-hreflang-values?hs_amp=true#looking-other-hreflang-issues)

## Why Order Matters in Hreflang

[Google expects](https://support.google.com/webmasters/answer/189077?hl=en) the language code to precede a country code. If the values in a hreflang attribute are in reverse order, it’s not valid. That means search engines won’t follow the instructions set by the hreflang. 

## Updating Hreflang Values

The solution here is simple: ensure the language code precedes the country code. If your order is incorrect, you can update the hreflang code. 

You’ll only want to rearrange the order of the country and language codes. If all other elements like the href URL are in place, they’ll require no changes of their own.

In order to do this, you may need help from the dev team. Or, you can make the update yourself if you have the proper edit permissions to change your site’s code. 

## Updating Hreflang Values at Scale

A second way to update your hreflang values is to use an [SEO execution platform](https://www.seoclarity.net/seo-automation/) like ClarityAutomate. The technology lets you scale your implementation across thousands of pages, all with just a few clicks. 

Here’s the quick step-by-step process that can be applied in ClarityAutomate to fix the issue of an invalid order. 

1. **Select what you'd like to optimize: Code**  
   You can optimize multiple areas of your site with ClarityAutomate, but since hreflang is part of your site’s code, that’s what we’re concerned with. 
2. **Choose how you'd like to optimize it: Update**  
   As opposed to adding or deleting elements, we want to update existing hreflang to change the order. 
3. **XPath location: XPath of the hreflang with the invalid order of hreflang values. **  
   This step narrows in on the hreflang that we’re looking to update. 
4. **Attribute: hreflang**  
   Then, you select “hreflang” in ClarityAutomate.
5. **New Value: The new value of hreflang with the correct order of hreflang values.**  
   Just like that, you’re able to set the new value of hreflang and push the changes live!

## Before and After

Notice how this hreflang originally included “us-en”. Now, we’ve updated it to correctly say “en-us”. 

#### Looking for other hreflang issues?

- [Conflicting Hreflang and rel=canonical](https://www.seoclarity.net/resources/knowledgebase/conflicting-hreflang-and-canonical) 
- [Hreflang with multiple defaults](https://www.seoclarity.net/resources/knowledgebase/hreflang-with-multiple-defaults) 
- [Invalid region in the Hreflang attribute](https://www.seoclarity.net/resources/knowledgebase/invalid-region-hreflang-attribute) 
- [Invalid language in the Hreflang attribute](https://www.seoclarity.net/resources/knowledgebase/invalid-language-hreflang-attribute) 
- [Hreflang with Duplicate Language/Region Combinations](https://www.seoclarity.net/resources/knowledgebase/hreflang-with-duplicate-language/region-combinations) 
- [Hreflang Missing Language Entry](https://www.seoclarity.net/resources/knowledgebase/hreflang-missing-language-entry) 
- [Underscore Instead of Dash in Hreflang](https://www.seoclarity.net/resources/knowledgebase/underscore-instead-dash-hreflang) 
- [Empty Hreflang URL](https://www.seoclarity.net/resources/knowledgebase/empty-hreflang-url) 
- [Hreflang Not Present](https://www.seoclarity.net/resources/knowledgebase/hreflang-not-present) 
- [Hreflang Present Outside <head>](https://www.seoclarity.net/resources/knowledgebase/hreflang-present-outside) 
- [Hreflang URL Is Invalid](https://www.seoclarity.net/resources/knowledgebase/hreflang-url-invalid) 
- [No self-referencing Hreflang tag](https://www.seoclarity.net/resources/knowledgebase/no-self-referencing-hreflang-tag) 
- [Hreflang Using Relative links](https://www.seoclarity.net/resources/knowledgebase/hreflang-using-relative-links) 

[View full post](https://www.seoclarity.net/resources/knowledgebase/glossary/hreflang/invalid-order-hreflang-values)

```json
{
  "@context" : "http://schema.org",
  "@type" : "BlogPosting",
  "author" : {
    "@type" : "Person",
    "name" : "Suraj Lalchandani"
  },
  "dateModified" : "2023-05-24T16:37:42.124Z",
  "datePublished" : "2023-05-04T20:13:14Z",
  "headline" : "Invalid Order of Hreflang Values",
  "image" : {
    "@type" : "ImageObject",
    "height" : 601,
    "url" : "https://www.seoclarity.net/hubfs/page_hreflang_11_invalidorderoffrelangvalues.png",
    "width" : 1201
  },
  "mainEntityOfPage" : "https://www.seoclarity.net/resources/knowledgebase/glossary/hreflang/invalid-order-hreflang-values",
  "publisher" : {
    "@type" : "Organization",
    "logo" : {
      "@type" : "ImageObject",
      "height" : 60,
      "url" : "/hs/hsstatic/content_shared_assets/static-1.4092/img/default-amp-logo.png",
      "width" : 60
    },
    "name" : "Knowledge Base"
  }
}
```