What are hreflang tags?
Hreflang tags are HTML attributes that tells search engines, crawlers, and AI search tools which language you are using on a specific page so it can show that result to users who are searching in that language.
They help you provide your content to users who speak multiple languages and reside in different regions around the world without creating duplicate content on your website.
What do hreflang tags look like?
Wondering what a hreflang example looks like? A hreflang tag appears as the following syntax in web page code — <link rel=”alternate” hreflang=”x” href=”https://example.com/alternate-page”/>. Every time you add a hreflang tag to your web page’s HTML, you’ll customize the syntax to match the corresponding web page. Three parts make up the syntax:
- The first (link rel=”alternate”) tells the search engine the webpage is an alternate version of the original.
- The second (hreflang=”x”) exhibits the web page’s language.
- The third (href=”https://example.com/alternate-page”/) highlights the URL of the alternative web page.
Let’s say that you’re customizing your “Contact Us” web page so that people who speak French can read it. The syntax would appear as follows — <link rel=”alternate” hreflang=”fr-fr” href=”https://example.com/contact-us”/>. Whenever someone with an IP address located in France navigates to that URL, they’ll be able to click a prompt that translates the content to French.
How do hreflang tags work?
Hreflang tags do several jobs for websites that serve more than one language or region. Here are the key functions they serve:
- Serve the right language: Hreflang tags tell search engines which language and region a page targets, so a searcher in France sees your French version of the page.
- Avoid duplicate content issues: When you publish near-identical pages for different regions, such as English for the U.S. and English for the U.K., hreflang tags mark them as alternates so they don’t compete in search results.
- Act as a signal, not a directive: Google treats hreflang as a hint it can override, so make sure your canonical tags and page content support the version you want shown.
- Link your page versions together: Each version needs return links to the others, and search engines may ignore tags that lack them.
Why should websites use hreflang tags?
Now that you know what hreflang tags are and how they work, here is why you should use them:
- Faster, easier discovery: Hreflang tags help users find the right version of your site in search results. When someone in France searches for your business, for example, they see your French page right away.
- Better user experience: More people can understand and navigate your content when it appears in their language.
- Higher conversion rates: Visitors who find your content in their own language can read what they see with no trouble, which makes them more likely to become customers.
- Stronger SEO: Google recommends hreflang tags for localized versions of a page, and they help the search engine understand what you’re aiming to accomplish. Following Google’s recommendations is one of the most reliable ways to protect your rankings.
To go deeper, our international SEO strategies guide covers how hreflang fits alongside URL structure, content localization, and international keyword research. Sites with international audiences that skip hreflang tags weaken their online presence.
How to implement hreflang tags
Ready to add hreflang tags on your site? Follow these steps to implement hreflang tags on a site that serves more than one language or region!
1. Map out your language and region versions
List every language and region you want to target, then match each one to a real page on your site. For example, you might have English pages for the U.S. and U.K. plus a Spanish page for Mexico. Make sure each version carries content built for that audience. Hreflang tags only connect pages that already exist, so build or translate the pages first. Skip regions you can’t support yet.
2. Pick the correct language and region codes
Hreflang values start with a language code, followed by an optional region code, such as en-gb for English in the United Kingdom or es-mx for Spanish in Mexico. Language codes use the ISO 639-1 format, and region codes use ISO 3166-1 Alpha 2. A region code can’t stand alone, so always lead with the language. Double-check each value, because search engines skip tags with invalid codes.
3. Choose where to place the tags
You have three options. Add link elements to the head section of each page’s HTML, send the tags in HTTP headers for non-HTML files like PDFs, or list them in your XML sitemap. HTML tags suit small sites, while sitemaps scale better for large international sites with many versions. Pick one method and stick with it to avoid conflicting instructions. Your developer or CMS plugin can often handle the setup.
4. Add self-referencing and return tags to every version
Every page needs a tag pointing to itself and a tag for each alternate version, and the full set must appear on every page in the group. If your English page links to the French page, the French page must link back. Add an x-default tag for visitors whose language or region doesn’t match any version. Missing return links cause search engines to ignore the tags. Keep each version’s canonical tag pointing to itself.
5. Test and monitor your tags
Run your pages through a hreflang checker tool after you publish to catch syntax errors, missing return links, and wrong codes. Make sure every tagged URL is indexable and returns a 200 status code. Then check country-level traffic in Google Search Console and your analytics over the following weeks to confirm the right versions reach the right audiences. Recheck whenever you add, move, or remove a page.
Tips to remember when adding hreflang tags
Here are a few quick points to keep in mind as you add hreflang tags to your web pages:
- Remember to index: Be sure to index each web page — original and alternative — as you add hreflang tags. This method ensures Google sees and understands the tags.
- Include return links: Always include a return link when dealing with an original web page and an alternative web page. This link ensures that when the original version directs users to the alternative one, the reverse will happen, too. In other words, remember that hreflang tag web pages come in pairs.
- Use the right language and region codes: Be sure to double-check that you’re incorporating the correct language and region codes. If you think you might need help with the syntax, you can use a free online hreflang tag generator to do the work for you.
- Keep regional languages in mind: While people from Mexico and Spain both speak Spanish, that doesn’t mean you can give them the same version of a web page. Ensure you’re paying attention to the region part of the syntax as much as the language to deliver the best possible user experience.
- Try a checker tool: Consider using a hreflang tag checker tool after you’ve implemented a hreflang tag into one of your web pages. This way, you’ll be able to see if it worked or if you need to make some changes.
Enhance your website’s reach with Hreflang tags
Implementing hreflang tags is crucial for websites targeting international audiences. By using these tags, you ensure that users see the correct language version of your pages, improving their experience and increasing your chances of conversions.
Interested in optimizing your website for a global audience? Learn how our expert team can help you implement hreflang tags and enhance your overall SEO strategy. Contact us online today to get started!
Let’s Drive Results Together 
Meet
Connect with us, today!
Writers
Related Resources
- What Are Breadcrumbs in SEO?
- What Are Core Web Vitals? A Digital Marketer’s Ultimate Guide
- What Are Featured Snippets?
- What Are Google Search Partners in Google Ads?
- What Are Keywords in SEO? A Comprehensive Look at Keywords and Their Role
- What Are KPI’s and Why Do They Matter?
- What Are Meta Keywords and Should I Use Them?
- What Are Nofollow Links? How Nofollow Links Affect SEO
- What Does Cost Per Click Mean and Why Does It Matter?
- What is a CMS? Your Guide to Content Management Systems