Hreflang Tags: How to Get the Attribute (Mostly) Right in Implementation 
|

Hreflang Tags: How to Get the Attribute (Mostly) Right in Implementation 

Even the most seasoned SEO professionals can find hreflang tags challenging. Google’s John Mueller once called the tags, “…one of the most complex aspects of SEO (if not the most complex one).” 

It’s not only that the concept itself is difficult, but its implementation also demands absolute precision. A single broken link or incorrect country code can invalidate your entire effort, leaving your international users with a frustrating experience.

Getting it right, however, is a non-negotiable cornerstone of any successful international or multi-language SEO strategy, ensuring the right content reaches the right audience.

Need help with your International SEO?

What Does the Hreflang Attribute Actually Do?

At its core, hreflang in SEO is a signal that helps search engine crawlers understand when you have alternate versions of a page for different audiences in different languages. 

For example, you may have separate pages for:

  • English speakers in the US vs. the UK, with localization to ensure appropriate word spelling and cultural references.
  • Users who see prices in US dollars, UK pounds, Canadian dollars, or Mexican pesos.

Without this clarity, Google might see your nearly identical US and UK pages and flag them as duplicate content or serve your US version to users in the UK. This can lead to keyword cannibalization, where your own pages compete against each other in search results, and can dilute your ranking signals by splitting them across multiple URLs.

Crucially, hreflang is used primarily to swap URLs, not to boost Google rankings. When your page earns a spot in search results, Google performs a final check to see if an alternate version would be more relevant to the user’s language and location, and then swaps it in if needed. 

This happens just before the search results are displayed. If the tags are set up incorrectly, this swap fails, and search engines can simply ignore them.

Hreflang vs Canonicals

Another important aspect to note is that hreflang tags are not the same as canonical tags, and they aren’t interchangeable

An hreflang tag tells search engines that a specific page should be displayed on SERPs for users of a certain language and location. A canonical tag tells search engines to index a specific page instead of others that have similar or duplicate content. 

These two tags should be used in tandem: an hreflang tag that clusters a group of alternate page versions, and self-referential canonical tags on each of those pages to tell Google to index each variation for users, but only show the correct language and country combination.

The Anatomy of an Hreflang Tag

Let’s break down what an hreflang tag is and how to use the tag for SEO: 

<link rel=”alternate” href=”https://example.com/en-us” hreflang=”en-us” />

  • rel=”alternate”: Tells the browser this is one of the potential versions of the page. 
  • href=”URL”: The full, absolute URL of the alternate page. Using a relative URL (like “/en-us”) will break the tag. This URL must point to a live, indexable page.
  • hreflang=”language-country”: Specifies the target language (using two-letter ISO 639-1 codes) and, optionally, the country (using ISO 3166-1 Alpha 2 codes). You can target a language broadly (e.g., “en” for all English speakers) or a specific region (e.g., “en-us” for English speakers in the US).
  • hreflang=”x-default”: This is your strategic fallback. It tells Google which page to show when no other tag matches the user’s location or language. You can set this to your highest-authority page (often the US English version) or, preferably, a dedicated country-selector page to give users a choice.

How to Implement Hreflang (The Smart Way)

You have three options for implementing the tag, but one is the clear winner for scalability and maintenance:

  • HTML <head>: In the method most SEOs know, an hreflang cluster is placed as HTML code in the tag of every version of the page.
    • Placing tags on every page is easy for a few pages, but quickly becomes a maintenance nightmare. Every time you add a new country version, you must update the code on every other page in that cluster, creating numerous opportunities for human error. This additional code can lead to code bloat, potentially slowing page load times.
  • XML Sitemap: In the recommended approach, you add hreflang information to your existing XML sitemap, or create an entirely separate XML sitemap for your hreflang clusters.
    • This method centralizes all the logic in one place, keeping your page code clean and easier to manage without affecting page speed. The drawback with this approach is that it can be a bit more technically complex up front and doesn’t make as much sense for smaller websites.
  • HTTP Headers: This method is quite niche as it’s only used for non-HTML content like PDFs and requires technical server access.

The Rules You Can’t Afford to Break

To ensure Google understands and trusts your tags, follow these rules without exception:

  1. Reciprocity: If Page A links to Page B, Page B must link back to Page A. Think of this as a digital handshake. It’s a verification mechanism that proves to Google you have control over both pages, and they agree on their relationship. Without this two-way confirmation, the connection is considered broken.
  2. Self-Reference: Every page needs an hreflang tag that points back to its own URL. This acts as an anchor, clearly establishing that page’s role within the interconnected “cluster” of international pages.
  3. Absolute URLs: All links in the hreflang tag must be the absolute version and include the delivery method. This means you need to reference full URLs (ex. https://www.example.com/en/test), not the relative versions (ex. /en/test or example.com/en/test) 

Most Hreflang Implementations Are a Mess

At the end of the day, hreflang tags are a suggestion, not a directive for Google. This means that they can be ignored, even if everything is correct. However, most implementations aren’t fully correct, making it pretty easy for Google to ignore them. 

A 2023 Ahrefs study found that a shocking 67% of domains using hreflang have at least one issue. This doesn’t even count the websites that should be using hreflang but aren’t. When hreflang fails, you face signal dilution, wasted development effort, and failed URL swapping; the very problems you were trying to solve. 

The most common mistakes are surprisingly simple, yet devastating to your setup:

  • Missing the x-default tag (56.3% of domains), leaving a gap for international users without a match.
  • Missing a self-referencing tag (18%), leaving pages unanchored within their cluster.
  • Pointing to a broken or redirected page (16.9%), which sends crawlers to a dead end.
  • Missing the reciprocal tag (15.3%), breaking the chain of trust, and often invalidating the entire cluster.
  • Pointing to a non-canonical URL (8%), which sends confusing and conflicting signals to Google.

Final Takeaways

As you embark on implementing hreflang tags, be sure to remember these key points:

  1. Most hreflang is broken. Assume your site has issues until a thorough audit proves you wrong. Don’t just set it and forget it.
  2. Hreflang’s job is to swap URLs. Its failure directly results in a frustrating experience for your international users and can lead to lost conversions.
  3. Use XML sitemaps. Save your future self the headache of untangling a web of HTML tags. It is the most robust and error-resistant method.
  4. Audit regularly. Developer updates, CMS changes, or simple human error can easily break your implementation without warning. Make hreflang checks a routine part of your technical SEO process. Tools like Screaming Frog, Ahrefs, and SEMrush can help you spot the top errors quickly.

Hreflang Implementation with Greenlane Marketing

We hope this blog cleared up some confusion around hreflang for you, but we’re here to help if needed.

We’ve helped both international and domestic businesses improve their existing setups and those that began their international expansion. 

Whether you are just looking to sell in Canada or you’re looking further overseas, Greenlane’s technical SEO specialists can help make sure you don’t become a part of the 67% in the next industry study. Explore our Technical SEO Services today.

Similar Posts