Hreflang
Hreflang is an HTML tag that tells Google and other search engines that a page is available in multiple languages or for multiple countries, and where the other versions are located. This allows the search engine to show the Swedish customer the Swedish page and the Danish customer the Danish page, rather than treating them as duplicates.
What is hreflang?
When an online store is available in multiple languages, the same product typically has one page per language: one in Danish, one in Swedish, and one in English. To a search engine, this looks like three different pages with nearly identical content. Hreflang solves this by indicating that the pages are versions of each other and specifying the language and country for each version.
Hreflang is written as links in the page’s `<head>` section, one per version, including for the page itself:
<link rel="alternate" hreflang="da-DK" href="https://dinshop.dk/filterkaffe"> <link rel="alternate" hreflang="sv-SE" href="https://dinshop.dk/se/filterkaffe-sv"> <link rel="alternate" hreflang="x-default" href="https://dinshop.dk/filterkaffe">
The code consists of a language, such as da, sv, or en, and possibly a country, such as en-GB for English in the United Kingdom or de-AT for German in Austria. "x-default " is the version the search engine should display when none of the languages match the searcher’s.
Why is hreflang important?
- The customer lands on the page in their own language. A Swedish customer searching for a product will see the Swedish page in the search results, not the Danish one.
- The pages do not compete with each other. Without hreflang, the search engine may perceive the language versions as duplicates and select the wrong one.
- The price and currency are correct. When the customer lands on the correct country page, they see that country’s prices and currency from the very first click.
Common Mistakes
- Links that only go one way. The Danish page must link to the Swedish one, and the Swedish page must link back to the Danish one. Otherwise, Google will ignore them.
- Links to pages that don’t exist. Each URL must lead to an actual page in the language specified by the code.
- Two sets of links on the same page. If the page contains both your own hreflang tags and those set by the system, they may contradict each other.
- Untranslated pages with hreflang. A “Swedish” page with Danish text is not a Swedish version and should not be included in hreflang.
Hreflang in Shoporama
If you sell in multiple countries using the “Countries” feature, Shoporama sets hreflang automatically. Each page receives a link to itself and to the same page in the main country and the active countries, using the country’s language and country code (e.g., sv-SE), while x-default points to the main country. The links use the page’s translated address in each country.
A product, category, or page that has not yet been translated into a country’s language is not included in the hreflang for that country. It is also marked as `noindex` in that country and is not included in the country’s sitemap, so Google does not see the Danish text under that country’s address. Shoporama also sets the page’s language in the `html lang` attribute, including in the main country.
If you’ve added hreflang tags to your theme yourself, they won’t be removed, so be sure to remove them when you start using Countries. If, instead, you have separate online stores for each country, you’ll need to add the hreflang tags to the theme yourself. Read more in “Hreflang and Multilingual Online Stores ” and “Sell in Multiple Countries with Lande.”
How to Use Shoporama
Guides that demonstrate the concept in practice
Translate your online store into other languages
How to translate your online store when selling in multiple countries: automatic translation, status by language,...
Hreflang and Multilingual Online Stores
How Shoporama sets `hreflang`, `x-default`, and `html lang` for your countries, what happens to untranslated pages,...
Sell in multiple countries and in multiple languages
Here's how to sell in other countries in your customers' languages and currencies using "Countries": Add a country,...
SEO in Shoporama
Complete guide to the SEO features in Shoporama - from meta tags and sitemap to Google Shopping and AI Assistant.
We know online marketing in Shoporama
We've been working with online marketing ourselves for decades. As the only shop system in the country, we have spoken multiple times at conferences such as Marketingcamp, SEOday, Shopcamp, Digital Marketing, E-commerce Manager, Ecommerce Day, Web Analytics Wednesday and many more.