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. 

  1. 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. 
  2. 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). 
  3. 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>! 
  4. 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. 
  5. 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?