OpenCart — UASK.PRO

Language folders, the database and hreflang

Old stores often have more language folders on disk than languages in the database. The mismatch can produce a flood of hreflang errors from a single cause.

A classic of older multilingual stores: there are more language folders in the files than languages in the database, often left over from renames such as ua-ua to uk-ua.

Compare the two

ls catalog/language/
SELECT code, status FROM oc_language;

Why it matters

The mismatch produces a flood of hreflang errors in a site audit. On one real shop it was 883 pages with "Missing Self-Reference" and 430 with "Missing Confirmation Links": a third of the site, from one cause.

Cleaning up

Remove the extra folders only after checking that nothing refers to them:

Then re-run the audit and compare canonical and hreflang on a few pages against the live site, not only in the code.

See also: Webroot hygiene and error display.