Language codes are a necessary component for hreflang attributes. If hreflang attributes are missing the language code, they’ll need to be added accordingly.
This can be done page-by-page, or at scale across thousands of pages. Here’s how.
When it comes to hreflang tags, Google's guidelines state that you should not specify a country code by itself. Since Google does not automatically derive the language from the country code, you must specify a language code yourself.
And so, you’ll want to ensure that all hreflang attributes that have the country attribute also have a language attribute.
You can add a language to your hreflang on a page-by-page basis if you have direct access to your CMS and the ability to update code.
The dev team may have to get involved, too.
Recommended Reading: Local SEO Language Considerations for European Countries
Adding a language entry to your hreflang attribute doesn’t have to be a manual process. With ClarityAutomate, an SEO execution platform, you can update your hreflang and set the appropriate language with just a few clicks,
Another benefit: you can do this without involving the dev team! Here’s how.
Since hreflang is part of your page’s code, that’s what we’re looking to optimize for this fix.
The hreflang already exists on the page, so we just need to update it (as opposed to adding or deleting it).
Specify the location of the tag with the error.
Now, we can specify that we’re updating the hreflang attribute.
The last step is to add the language entry. Don’t forget to review hreflang language codes!
The following hreflang attribute was missing a language entry. Notice how we changed the attribute to add an “en” that accompanies the “us”.