# Translate Open Graph and set og:locale

- Check 25.09 · Translating SEO elements · Important
- Source: https://checklist-seo-geo.com/en/translating-seo-elements/translate-open-graph-set-oglocale
- Translate og:title, og:description and share images for each language, and set og:locale in the right format on WordPress, Shopify, Drupal, Laravel or Next.js.
- Updated on 2026-11-25
- Licence: CC BY 4.0. Credit “Checklist SEO & GEO” with a link to https://checklist-seo-geo.com/en/translating-seo-elements/translate-open-graph-set-oglocale.
- Plugin checklist-seo-geo: 1.3.1 · https://github.com/maximegaul/checklist-seo-geo

## In short

Open Graph tags determine what Facebook, LinkedIn, messaging apps and many other services display when a link is shared: title, description, image. On a multilingual site, each version must have its own tags, in its language, and declare its locale with `og:locale` in the `language_TERRITORY` format (`de_DE`, `en_GB`). Once this check is done, a link to `/de/` shared on a social network is displayed in German, with a suitable image, and is no longer confused with the French version.

## Why it matters

When a link is shared, the service that generates the preview downloads the page and reads its `og:` tags; it translates nothing. If the German version inherits the French tags, because the theme hard-codes them or the SEO plugin only has social fields for the primary language, the preview is in French for every German reader.

The Open Graph specification defines `og:locale` as the locale the tags are written in, in the `language_TERRITORY` format, with `en_US` as the default. A German page without `og:locale` is therefore declared, by default, as American English. `og:locale:alternate` lists the other locales in which the page is available. These tags do not replace hreflang: they do not give the URLs of the other versions, and Google does not use them for language targeting. Nor does Meta detail the exact effect of `og:locale` on display: treat it as a consistency declaration, not as a lever.

Finally, previews are cached. A page shared before its translation may keep displaying the old text until the service reads it again.

## What it improves

- **Click-through rate of shares**: title, description and image in the language of the people who see the link.
- **Brand consistency** per market: visuals and taglines adapted to the country.
- **Shares through assistants and messaging apps**: many tools that display a link preview read the same tags.
- **SEO**: no direct effect. Open Graph tags are not a ranking factor; the effect comes through the visibility of shares.

## How to check

Compare the tags of the same page in each language:

```bash
for u in https://example.com/fr/thes/the-vert/ https://example.com/de/tees/gruener-tee/ https://example.com/en/teas/green-tea/; do
  echo "== $u"
  curl -s -A "facebookexternalhit/1.1" "$u" | grep -o -i -E '<meta (property|name)="(og|twitter):(title|description|locale|locale:alternate|url|image|image:alt)"[^>]*>'
done
```

Compliant result for the German version:

```html
<meta property="og:locale" content="de_DE">
<meta property="og:locale:alternate" content="fr_FR">
<meta property="og:locale:alternate" content="en_GB">
<meta property="og:url" content="https://example.com/de/tees/gruener-tee/">
<meta property="og:title" content="Grüner Tee lose kaufen">
<meta property="og:description" content="Rund 40 Grüntees aus Japan und China …">
<meta property="og:image" content="https://example.com/media/og/gruener-tee-de.jpg">
```

Points to check: a single `og:locale` per page, in the underscore format; `og:url` equal to the canonical URL of the version; no title or description identical to the source version; `og:image:alt` translated.

Then test the actual rendering:

- **Facebook**: paste the URL into Meta's [Sharing Debugger](https://developers.facebook.com/tools/debug/). It shows the tags it read and fetches the page again.
- **LinkedIn**: the [Post Inspector](https://www.linkedin.com/post-inspector/) shows the preview and refreshes LinkedIn's cache.

The complete method for testing previews is in [test social sharing](https://checklist-seo-geo.com/en/page-seo-metadata/test-social-sharing).

## How to implement

### Before you start

What to translate or adapt in each version:

| Tag | Action | de example |
|---|---|---|
| `og:title`, `twitter:title` | Translate, or reuse the translated title | Grüner Tee lose kaufen |
| `og:description`, `twitter:description` | Translate | Rund 40 Grüntees aus Japan und China … |
| `og:image:alt`, `twitter:image:alt` | Translate | Tasse mit grünem Tee und Teeblättern |
| `og:image` | Localized image if it contains text, with a different URL | `gruener-tee-de.jpg` |
| `og:url` | Canonical URL of the version | `https://example.com/de/tees/gruener-tee/` |
| `og:site_name` | Brand name, unchanged unless there is an official local form | Maison du Thé |
| `og:locale` | Locale of the page | `de_DE` |
| `og:locale:alternate` | Locales of the other versions, one tag per locale | `fr_FR`, `en_GB` |

Mapping between the site's language codes (those of `lang` and hreflang, with a hyphen) and Open Graph locales (with an underscore and a territory):

| `lang` / hreflang | `og:locale` |
|---|---|
| `fr` or `fr-FR` | `fr_FR` |
| `fr-BE` | `fr_BE` |
| `fr-CA` | `fr_CA` |
| `de` or `de-DE` | `de_DE` |
| `de-AT` | `de_AT` |
| `en-GB` | `en_GB` |
| `en` or `en-US` | `en_US` |
| `es` or `es-ES` | `es_ES` |
| `pt-BR` | `pt_BR` |

For a version that targets a language without a specific country (`/de/` for all German speakers), choose the territory of your main market. The Open Graph specification accepts any combination of language and territory, but Meta publishes its own, shorter list of supported locales: it contains, for example, `fr_FR` and `fr_CA`, but not `fr_BE` or `de_AT`. The Open Graph tags in the page head are covered in [configure Open Graph and X Cards](https://checklist-seo-geo.com/en/page-seo-metadata/configure-open-graph-x-cards).

> **Warning:** Meta caches images by URL and does not update them as long as the URL does not change. For a localized image, use a language-specific file name rather than replacing the existing file.

X cards fall back on Open Graph tags when the equivalent `twitter:` tags are missing: if you only declare `twitter:card`, translating the `og:` tags is enough.

### WordPress

Versions: WordPress 6.4 to 7.1; Yoast SEO 20 and later or Rank Math 1.0, with WPML 4 or Polylang 3.

**Yoast SEO** generates `og:locale` from the page's WordPress language. With WPML or Polylang, this language changes for each translation: the locale follows. Yoast maps it to the list of locales supported by Facebook: a variant such as formal German (`de_DE_formal`) becomes `de_DE`, a locale missing from the list such as `de_AT` also becomes `de_DE`, and an unknown language falls back to `en_US`. Polylang also adds one `og:locale:alternate` tag per other language to Yoast's output. The social title and description are filled in on the `Social` tab of the Yoast box of each translation; left empty, they reuse the translation's title and meta description. The site's default values (image, home page description) are translated in `Languages > Translations` (Polylang) or `WPML > String Translation`.

**Rank Math**: same principle. The locale follows the WordPress language, and the fields on the `Social` tab of each translation carry the share title, description and image.

To force a regional locale that Yoast maps back to the main locale, use its `wpseo_og_locale` filter, which is applied last:

```php
// Child theme functions.php
add_filter('wpseo_og_locale', function (string $locale): string {
    return get_locale() === 'de_AT' ? 'de_AT' : $locale;
});
```

Only do this if the Austrian version is genuinely distinct from the German version.

### Shopify

Versions: Shopify, Horizon and Dawn themes, November 2026.

The Horizon and Dawn themes generate `og:title` and `og:description` from the page's title and meta description, already translated in Translate & Adapt, and `og:url` from the language URL. They do not write `og:locale`. Add it in `snippets/meta-tags.liquid`, present in both themes (or your theme's equivalent file), after `og:type`:

```liquid
{%- assign og_language = request.locale.iso_code | split: '-' | first -%}
<meta property="og:locale" content="{{ og_language }}_{{ localization.country.iso_code }}">
```

`request.locale` gives the displayed language and `localization.country` the country of the visitor's market: a German store viewed from Austria will produce `de_AT`. If you prefer a fixed locale per language, replace this logic with a hard-coded mapping. Test in the Sharing Debugger with a URL for each language prefix.

### PrestaShop

Versions: PrestaShop 8 and 9, Classic and Hummingbird themes.

Open Graph tags come from the theme or an SEO module. In the theme's header template, the locale of the current language is available in the `$language.locale` variable (`de-DE`), to be converted to the Open Graph format:

```html
<meta property="og:locale" content="{$language.locale|replace:'-':'_'}">
```

PrestaShop templates are written in Smarty: put this line in the theme's `head` block, for example in `templates/_partials/head.tpl` for a theme derived from Classic or Hummingbird (the default theme since PrestaShop 9.1).

The title and description reuse the `Meta title` and `Meta description` fields of each language.

### Drupal

Versions: Drupal 10 and 11; Metatag 2.

With Metatag's Open Graph submodule, fill in the `Locale` field and, if you wish, the alternative locales in the default values (`Configuration > Search and metadata > Metatag`). Use tokens for the title and description so that they follow the content translation. Default values are translated through configuration translation.

### Wix

Versions: Wix Editor and Wix Multilingual, November 2026.

Wix generates Open Graph tags from each page's social share settings. With Wix Multilingual, switch the editor to the secondary language and fill in the page's share title, description and image in that language, then check the result in the Sharing Debugger.

### Laravel

Versions: Laravel 10 to 13.

Declare the mapping between your languages and Open Graph locales in the configuration, then use it in the template:

```php
// config/app.php
'og_locales' => [
    'fr' => 'fr_FR',
    'de' => 'de_DE',
    'en' => 'en_GB',
],
```

```php
{{-- resources/views/partials/open-graph.blade.php --}}
@php($ogLocales = config('app.og_locales'))
<meta property="og:locale" content="{{ $ogLocales[app()->getLocale()] }}">
@foreach($ogLocales as $code => $ogLocale)
    @if($code !== app()->getLocale())
        <meta property="og:locale:alternate" content="{{ $ogLocale }}">
    @endif
@endforeach
<meta property="og:title" content="{{ $ogTitle ?? __('seo.default_og_title') }}">
<meta property="og:description" content="{{ $ogDescription ?? __('seo.default_og_description') }}">
<meta property="og:url" content="{{ $canonical }}">
<meta property="og:image" content="{{ $ogImage ?? asset('media/og/default-'.app()->getLocale().'.jpg') }}">
```

Only add `og:locale:alternate` for the languages in which the page actually exists.

### Next.js

Versions: Next.js 15 and 16 (App Router), next-intl 4.

In `generateMetadata`, fill in `openGraph.locale` and `openGraph.alternateLocale` from the route's language:

```ts
// app/[locale]/teas/[slug]/page.tsx
import type { Metadata } from 'next';
import { getTranslations } from 'next-intl/server';

const ogLocales: Record<string, string> = { fr: 'fr_FR', de: 'de_DE', en: 'en_GB' };

export async function generateMetadata({ params }: { params: Promise<{ locale: string; slug: string }> }): Promise<Metadata> {
  const { locale, slug } = await params;
  const t = await getTranslations({ locale, namespace: 'TeaPage' });

  return {
    title: t('title'),
    description: t('description'),
    openGraph: {
      title: t('ogTitle'),
      description: t('ogDescription'),
      url: `https://example.com/${locale}/teas/${slug}`,
      locale: ogLocales[locale],
      alternateLocale: Object.entries(ogLocales)
        .filter(([code]) => code !== locale)
        .map(([, ogLocale]) => ogLocale),
      images: [{ url: `https://example.com/og/${slug}-${locale}.jpg`, width: 1200, height: 630, alt: t('ogImageAlt') }],
    },
  };
}
```

The `openGraph` fields of a segment entirely replace those of the parent layout: declare the locale again in every page that defines its own Open Graph tags. For Facebook's crawler, Next.js waits for `generateMetadata` to finish before sending the response, so the tags are indeed in the `<head>`.

### After going live

For each important page that has already been shared, fetch it again in the Sharing Debugger (“Scrape Again”) and in LinkedIn's Post Inspector. Other services refresh their cache at their own pace, with no public tool to force it.

## Common mistakes

- **Open Graph tags hard-coded in the theme**, identical in every language.
- **`og:locale` in the `lang` format** (`de-DE` or `de`) instead of `de_DE`.
- **Missing `og:locale`**: the page is then declared as `en_US` by default.
- **`og:url` pointing to the French version** or to the home page, which groups shares under the wrong URL.
- **Image with text not localized**, or a localized image published under the same URL as the old one, which Meta's cache keeps serving.
- **`og:locale:alternate` pointing to languages in which the page does not exist.**
- **Not fetching the page again** after translation: the old previews stay in place.

## Frequently asked questions

### What format should be used for og:locale?

The og:locale tag uses the language_TERRITORY format with an underscore: fr_FR, de_DE, en_GB, pt_BR. This differs from the lang attribute and hreflang, which are written with a hyphen and accept a language on its own. Without og:locale, the Open Graph specification treats the page as en_US. For a version that targets a language without a specific country, choose the territory of your main market.

### Does og:locale:alternate replace hreflang?

No. The og:locale:alternate tag only indicates that the page exists in other locales, without giving the URL of these versions. Google does not use it for language targeting: that role belongs to hreflang, declared in the HTML, the HTTP headers or the sitemap. The two can coexist; hreflang remains essential, while og:locale:alternate is optional.

### Why does Facebook still show the old text after translation?

Facebook caches the preview of a URL after reading it the first time. Open Meta's Sharing Debugger, paste the URL of the translated version and fetch it again: the new tags are read immediately. For images, Meta keeps the cache as long as the image URL does not change; publish the localized image under a new file name.

### Do you need a different Open Graph image for each language?

Only if the image contains text, a price, a currency or a cultural element specific to one market. A product photo without text can be shared by every version. A banner with a French tagline must have one variant per language, published under a distinct URL, and og:image:alt alt text translated in each version.

## Resources

- [The Open Graph protocol](https://ogp.me/)
- [Meta: Sharing for webmasters](https://developers.facebook.com/docs/sharing/webmasters/)
- [X: Cards markup](https://developer.x.com/en/docs/x-for-websites/cards/overview/markup)
- [Yoast: Changing the og:locale output](https://developer.yoast.com/features/opengraph/api/changing-og-locale-output/)
- [Next.js: generateMetadata](https://nextjs.org/docs/app/api-reference/functions/generate-metadata)
- [Shopify: localization object](https://shopify.dev/docs/api/liquid/objects/localization)

Next steps: [test social sharing](https://checklist-seo-geo.com/en/page-seo-metadata/test-social-sharing) and [translate titles and meta descriptions](https://checklist-seo-geo.com/en/translating-seo-elements/translate-titles-meta-descriptions).
