Back to blog

How to Use Hreflang for Multilingual Websites Without Pulling Your Hair Out

webceke

How to Use Hreflang for Multilingual Websites Without Pulling Your Hair Out

So you’ve built a multilingual website—maybe with an AI website builder like webceke—and you’re proud of your French, Spanish, and German pages. But then you notice something weird: Google is showing the wrong language version in search results, or worse, it’s treating your translated pages as duplicates. That’s where hreflang tags come in. They’re small pieces of code that tell search engines which language and regional version of a page to show to which user. In this guide, I’ll explain hreflang in plain English and show you how to set it up correctly—even if you’ve never touched code.

What Exactly Is Hreflang?

Hreflang is an HTML attribute that you add to the <head> section of your web pages. It looks something like this:

``html <link rel="alternate" hreflang="en" href="https://example.com/" /> <link rel="alternate" hreflang="fr" href="https://example.com/fr/" /> ``

In simple terms, it says: “Hey Google, this page is the English version, and this other URL is the French version of the same content.” Without hreflang, search engines have to guess which version to show. They might show your English page to a user in France, or they might index all versions as duplicates and rank none of them well. Hreflang fixes that by giving clear signals.

Why Small Businesses Need Hreflang (Even with AI Builders)

If you’re using an AI website builder to create a multilingual site, you might think the tool handles everything. But many builders only translate the text—they don’t automatically add hreflang tags. That means you’re missing out on:

  • Better rankings in each target country – Google can match the right language version to the searcher’s location and language settings.
  • No duplicate content penalties – When you have the same content in multiple languages, search engines might see it as duplicate. Hreflang tells them it’s intentional and that each version is for a different audience.
  • Improved user experience – Visitors land on a page they can actually read, which reduces bounce rates and increases conversions.

For a small business aiming to sell internationally, hreflang is a must—not a nice-to-have.

How to Implement Hreflang Correctly (Step by Step)

Let’s walk through a practical example. Suppose you sell handmade pottery and have an English site at https://example.com/ and a Spanish version at https://example.com/es/. Here’s what you need to do:

  1. Add hreflang tags to every version of the page. On the English page, include a link to the Spanish version, and on the Spanish page, include a link back to the English version. Don’t forget to include a self-referencing tag (the page’s own URL) as well.
  1. Use the correct language and country codes. For English for the US, use en-us; for English for the UK, use en-gb. If you’re targeting all English speakers, just use en. Same for Spanish: es for general Spanish, es-mx for Mexico, es-es for Spain.
  1. Add a fallback with x-default. This tag tells Google which page to show when no other language matches. Usually, it’s your main page (often English). Example: <link rel="alternate" hreflang="x-default" href="https://example.com/" />
  1. Keep the URLs consistent. If your English page is at / and your Spanish page is at /es/, don’t change the URL structure later without updating the tags.
  1. Test your implementation. Use Google Search Console’s URL Inspection tool or the hreflang validator to check for errors.

Common Hreflang Mistakes to Avoid

Even experienced marketers mess up hreflang. Here are the top pitfalls:

  • Missing return tags. If you point from English to Spanish, you must also point from Spanish to English. If not, Google ignores the tags.
  • Using language codes incorrectly. en-uk is wrong—it’s en-gb. pt-br for Brazilian Portuguese, pt-pt for European Portuguese.
  • Forgetting to update hreflang on all versions. If you add a new language, you need to add the tag to every existing language page.
  • Mixing hreflang with canonical tags incorrectly. Canonical tells Google which page is the “main” one, while hreflang says “these are all versions.” Use both, but make sure they don’t conflict. For example, don’t set a canonical on your Spanish page pointing to the English page—that would tell Google the Spanish page is a duplicate.

How AI Website Builders Like webceke Can Help

If you’re using an AI website builder, you might not have direct access to the <head> section of your pages. That’s okay—webceke, for instance, lets you add custom code to the head of your site, so you can paste your hreflang tags there. Alternatively, if you’re using a CMS like WordPress, you can use a plugin like Yoast SEO or Rank Math to manage hreflang tags without touching code. The key is to understand the logic, and then use whatever tool you have to implement it.

A Simple Checklist for Your Multilingual Site

  • [ ] Every language version has a unique URL (e.g., /es/, /fr/).
  • [ ] Each page includes hreflang tags for all versions, including itself.
  • [ ] You’ve added an x-default tag.
  • [ ] You’ve used correct language and region codes.
  • [ ] You’ve tested with Google Search Console.

Ready to Go Global?

Hreflang might sound technical, but it’s really just a way to say “this page is for these people.” Once you get it right, your multilingual site will rank better, avoid duplicate content issues, and give your visitors exactly what they’re looking for. If you’re building your site with webceke, you can easily add the tags and start attracting customers from around the world. Why not give it a try? Your future international customers are waiting.

Keep reading