MetaEngine

How to Implement hreflang Tags Correctly (HTML, Sitemap & HTTP Header)

Managing international or multi-language websites without hreflang tags often leads to incorrect page rankings, duplicate content issues, and poor regional visibility. When implemented correctly, hreflang tags help search engines understand which version of a page should be shown to users based on language and location.

This guide explains how to implement hreflang tags correctly using HTML, XML sitemaps, and HTTP headers, along with common mistakes to avoid—especially for Irish and EU-focused websites.


What Are hreflang Tags?

hreflang tags are HTML attributes that signal to search engines which language and regional version of a page should be served to users. They are essential for international targeting and a core part of effective hreflang SEO.

For example:

  • en-IE → English (Ireland)

  • en-GB → English (United Kingdom)

  • fr-FR → French (France)

Google uses hreflang tags to avoid showing the wrong language or country version of a page in search results.


When Should You Use hreflang Tags?

You should implement hreflang tags if your website:

  • Targets multiple countries or regions

  • Has different language versions of the same content

  • Uses country-specific URLs (for example, /ie/ or /uk/)

  • Serves similar content to different locations

This is especially important for companies offering SEO for Irish Businesses that also target the UK, EU, or global markets.


Implementing hreflang Tags in HTML

This method places hreflang tags inside the head section of each page and is the most commonly used approach.


Example HTML Implementation

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

<link rel="alternate" hreflang="en-gb" href="https://example.com/uk/" />

<link rel="alternate" hreflang="x-default" href="https://example.com/" />


Key Rules to Follow

  • Every language version must reference all other versions

  • Self-referencing hreflang tags are required

  • Use valid ISO language and country codes

  • Include an x-default version where appropriate

HTML-based implementation works well for small to medium websites and is fully supported by google hreflang systems.


Implementing hreflang Tags via XML Sitemap

For large websites or ecommerce platforms, managing hreflang through XML sitemaps is often more efficient.


Example Sitemap Implementation

 
<url>
<loc>https://example.com/ie/</loc>
<xhtml:link rel="alternate" hreflang="en-ie" href="https://example.com/ie/" />
<xhtml:link rel="alternate" hreflang="en-gb" href="https://example.com/uk/" />
</url>


Benefits of Sitemap-Based hreflang

  • Easier to manage at scale

  • No need to edit individual page HTML

  • Cleaner setup for multilingual ecommerce websites

This approach is commonly used during advanced Website development projects with complex international structures.


Implementing hreflang Tags via HTTP Headers

This method is primarily used for non-HTML content such as PDFs or downloadable files.


Example HTTP Header Implementation

 
Link: <https://example.com/ie/file.pdf>; rel="alternate"; hreflang="en-ie",
<https://example.com/uk/file.pdf>; rel="alternate"; hreflang="en-gb"


When to Use HTTP Headers

  • PDF documents

  • Downloadable resources

  • Content not served as HTML

Although less common, this method is fully recognised by Google.


Common hreflang Mistakes to Avoid

Even small implementation errors can cause hreflang tags to be ignored.


Incorrect Language or Country Codes

Always use valid ISO codes such as en-ie, not en-ir.


Missing Return Tags

Every hreflang URL must reference all other related versions.


Canonical and hreflang Conflicts

Canonical tags should align with hreflang URLs, not override them.


Mixing Implementation Methods

Avoid combining HTML and sitemap-based hreflang for the same pages.


How to Check hreflang Errors in Google Search Console

hreflang issues can be reviewed in Google Search Console under legacy international targeting reports.

Common errors include:

  • Missing return links

  • Invalid hreflang values

  • URLs not matching sitemap entries

Resolving these issues is critical for successful hreflang SEO.


hreflang Tags Best Practices for Ireland

For Irish websites, regional targeting is just as important as language.

Best practices include:

  • Use en-ie specifically for Ireland

  • Avoid relying only on generic en

  • Clearly separate Irish and UK URLs

  • Ensure local signals such as currency and business details align with hreflang

This setup helps improve relevance and supports broader SEO services strategies.


Final Thoughts

hreflang tags are essential for any website targeting multiple regions or languages. Whether implemented through HTML, XML sitemaps, or HTTP headers, accuracy and consistency are key.

Correct hreflang implementation improves regional targeting, reduces duplicate content risks, and strengthens international search performance when done properly.

Get a Free SEO Audit

Find issues, opportunities, and growth insights with a quick expert audit.

Explain Your Project

Success

Thank you! Form submitted successfully.

This field is required
This field is required
This field is required
This field is required
This field is required

Countries We Serve