The hreflang attribute tells Google which language and country you are targeting for a specific page.
However, the hreflang tag can only do its job if it exists on the page in the first place. Here’s how to go along adding hreflang if it’s missing.
Table of Contents
When to Use Hreflang
If your site has pages that target multiple countries, having hreflang attributes set up is highly recommended by Google.
Hreflang allows search engines to serve the page result to users searching in that specific language and country.
How to Add Hreflang
To add the hreflang attribute, you’ll need to make edits on the back-end of your site. You may have direct edit access to these fields, or you may need to bring in the dev team.
To create the hreflang attribute, you’ll need a valid URL, plus the proper country and region code. Once compiled, this attribute can then be added across your site on a page-by-page basis within the <head> section of your site’s code.
Luckily, there’s another solution to this problem that lets you implement hreflang in a matter of minutes.
Create and Deploy Hreflang at Scale
SEO execution platform ClarityAutomate lets you push hreflang live on your site with just a few clicks. This way, you can tackle this issue on your own timeline without having to wait for the dev team to come around.
Plus, the attribute can be added across thousands of pages. If a page targets multiple countries, hreflang can be added with this 5-step process.
- Select what you'd like to optimize: Code
Hreflang is a part of your site’s code, so that’s what we’re looking to optimize in this scenario. - Choose how you'd like to optimize it: Add New
Since our main issue is that the hreflang is not present, we need to add that element (as opposed to deleting or updating it). - XPath location: XPath within the <head> where you would like the hreflang attribute added
This step specifies the location of the hreflang — just make sure it’s within the <head>! - Specific Location: You can choose “Add before location” or “Add after location” depending on where you want it added
ClarityAutomate gives you full control over where the hreflang attribute will be added. - Code: The full hreflang that you would like added.
Then, just drop in your hreflang and push your changes live. It’s as simple as that.
Looking for other hreflang issues?
- Conflicting Hreflang and rel=canonical
- Hreflang with multiple defaults
- Invalid region in the Hreflang attribute
- Invalid language in the Hreflang attribute
- Hreflang with Duplicate Language/Region Combinations
- Hreflang Missing Language Entry
- Underscore Instead of Dash in Hreflang
- Empty Hreflang URL
- Hreflang Present Outside <head>
- Hreflang URL Is Invalid
- Invalid order of Hreflang values
- No self-referencing Hreflang tag
- Hreflang Using Relative links