Translating your OpenCart store is only half of the work. If Google does not understand which page belongs to which language, it may show your English product to a German customer, or treat the translations as duplicate content. This guide covers the two things that fix it: translated SEO URLs and hreflang tags.
1. Translated SEO URLs
OpenCart stores one SEO keyword per product, category and page for each language. If you add a language without translating them, every language uses the same English keywords. A translated keyword helps the page rank for the words people search in that language:
/en-gb/running-shoes/it-it/scarpe-da-corsa/fr-fr/chaussures-de-course
Rules that avoid problems:
- keywords must be unique per store and language;
- use lowercase, hyphens instead of spaces, and transliterate accented or non-Latin letters;
- for sub-categories, the path should be translated too (
/it-it/scarpe/scarpe-da-corsa); - never change keywords that already rank, unless you add redirects.
Enable them in System > Settings > Server > Use SEO URLs (on Apache rename .htaccess.txt to .htaccess).
2. Language in the URL (OpenCart 4)
OpenCart 4 puts the language code in the URL (/de-de/...), so each language version has its own address. This is what makes hreflang possible. OpenCart 3 keeps the language in the visitor's session instead, with the same URL for all languages, so search engines usually see only one language.
3. hreflang tags
hreflang tags are lines in the page <head> that list every language version of the same page:
<link rel="alternate" hreflang="en-GB" href="https://example.com/en-gb/running-shoes"/>
<link rel="alternate" hreflang="it-IT" href="https://example.com/it-it/scarpe-da-corsa"/>
<link rel="alternate" hreflang="x-default" href="https://example.com/en-gb/running-shoes"/>
Common mistakes:
- missing return links: every version must list all the others, itself included;
- using the URL of another page (for example the home page) as the alternate;
- wrong codes (
en-UKinstead ofen-GB); - adding hreflang to private pages such as cart, checkout and account, which should not be indexed;
- forgetting
x-default, the version for everyone else.
Automating both
Doing this by hand for every product is tedious and easy to get wrong. AI Translator for OpenCart creates the translated SEO keyword for every product, category and page when it translates them (unique per store, with the translated parent path, and without ever changing keywords you typed yourself), and on OpenCart 4 it adds correct hreflang and x-default tags to every public page.
See it on a live store: the OpenCart 4 demo storefront has Italian and Arabic versions with hreflang tags (view the page source), and you can try the admin with user demo, password demo. More in the documentation and in our guide on making an OpenCart store multilingual.