# Use inLanguage on compatible types

- Check 28.09 · Multilingual linking and schema · Important
- Source: https://checklist-seo-geo.com/en/multilingual-linking-schema/use-inlanguage-compatible-types
- Declare inLanguage on WebSite, WebPage, Article and the other types that accept it, with the page's language code, on WordPress, Shopify, 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/multilingual-linking-schema/use-inlanguage-compatible-types.
- Plugin checklist-seo-geo: 1.3.1 · https://github.com/maximegaul/checklist-seo-geo

## In short

`inLanguage` is the schema.org property that states the language of a piece of content. On a multilingual site, every entity that accepts it (page, article, site, video, event) should carry it with the language code of the version displayed, identical to the `lang` attribute of the `html` element. Types that do not accept it, such as `Product`, `Organization` or `Person`, do not get it: the language goes through the page that contains them or through a dedicated property. Once the task is done, the JSON-LD of each version announces its own language, with no value hard-wired to the default language.

## Why it matters

schema.org defines `inLanguage` as the language of the content, expected in IETF BCP 47 format (`fr`, `fr-FR`, `en-GB`), and attaches it to `CreativeWork` and its subtypes, to `Event`, to `BroadcastService` and to a few actions. It does not exist on `Product`, `Offer`, `Organization`, `LocalBusiness`, `Person` or `Place`.

Google states that it determines the language of a page from its visible content and that it does not use language information placed in the code, such as the `lang` attribute or the URL. None of its rich result documentation makes `inLanguage` a required or recommended property. Its value lies elsewhere:

- **Consistency**: JSON-LD announcing `en-US` on a French page sends a contradictory signal to any tool that reads structured data, and often betrays a template that was never localized.
- **Multilingual graph**: when several versions of the same page coexist, `inLanguage` is what explicitly tells them apart in the data.
- **Other readers**: search engines, aggregators and agents that use JSON-LD without analyzing the text. No generative engine documents its use of `inLanguage`; the effect on citations is a hypothesis.

It is a cheap task with a weak direct effect, which mainly serves as a safeguard.

## What it improves

- **Structured data consistent** with the visible language, the `lang` attribute and the `hreflang` annotations.
- **Detection of non-localized templates**: a hard-wired value reveals JSON-LD blocks that ignore the current language.
- **Clean validation**: no more unknown property on `Product` or `Organization`.
- **Rankings and AI answers**: no documented direct effect.

## How to check

Compare the `lang` attribute and the `inLanguage` values of each version:

```bash
for url in https://example.com/ https://example.com/en/ https://example.com/de/; do
  echo "== $url"
  curl -s "$url" | grep -o -E '<html[^>]* lang="[^"]+"|"inLanguage": ?"[^"]+"' | sort | uniq -c
done
```

Expected result: on each version, all `inLanguage` values are identical to the `lang` attribute (`fr-FR` on the French version, `en-GB` on the English version). A default-language value on a translated page points to a template to fix.

Then paste a product page into the Schema Markup Validator: a warning that `inLanguage` is not recognized for `Product` or `Organization` points to a property placed on a type that does not accept it.

## How to implement

### Before you start

Where to put the language depending on the type:

| Type | Property | Note |
|---|---|---|
| `WebSite` | `inLanguage` | A list if the same site covers several languages |
| `WebPage` and subtypes (`CollectionPage`, `ProfilePage`, `FAQPage`…) | `inLanguage` | Language of the version displayed |
| `Article`, `BlogPosting`, `NewsArticle` | `inLanguage` | Language of the article's text |
| `ImageObject`, `VideoObject` | `inLanguage` | Language of the image's text, of the video's audio |
| `Course`, `Event` | `inLanguage` | Language of the course or event |
| `Product`, `ProductGroup`, `Offer`, `Service` | none | Carried by the `WebPage` that contains them |
| `Organization`, `Person` | `knowsLanguage` | Languages spoken, not the page's language |
| `ContactPoint`, `LodgingBusiness` | `availableLanguage` | Languages of customer service, of the front desk |

Rules:

- **Same code as the `lang` attribute**: choose one form (`fr` or `fr-FR`) and keep it everywhere, in the HTML, the JSON-LD and the `hreflang` annotations.
- **One value per page entity**: a page in English carries `en-GB`, not the list of the site's languages.
- **Value computed** from the current language of the CMS or framework, never hard-coded in a shared template.
- **Actual language**: a page whose content is not yet translated must not announce the target language. See [avoid mixed-language pages with partial translations](https://checklist-seo-geo.com/en/international-architecture/avoid-mixed-language-pages-partial-translations).

Example for the English page of a product:

```html
<script type="application/ld+json">
{
  "@context": "https://schema.org",
  "@graph": [
    {
      "@type": "WebSite",
      "@id": "https://example.com/#website",
      "url": "https://example.com/",
      "name": "Maison Thé",
      "inLanguage": ["fr-FR", "en-GB", "de-DE"]
    },
    {
      "@type": "ItemPage",
      "@id": "https://example.com/en/products/cast-iron-teapot/#webpage",
      "url": "https://example.com/en/products/cast-iron-teapot/",
      "name": "Cast iron teapot, 1.2 L",
      "inLanguage": "en-GB",
      "isPartOf": { "@id": "https://example.com/#website" },
      "mainEntity": { "@id": "https://example.com/en/products/cast-iron-teapot/#product" }
    },
    {
      "@type": "Product",
      "@id": "https://example.com/en/products/cast-iron-teapot/#product",
      "name": "Cast iron teapot, 1.2 L",
      "sku": "TH-FONTE-12"
    }
  ]
}
</script>
```

The `Product` does not carry `inLanguage`: the page that presents it does so on its behalf.

### WordPress

Versions: WordPress 6.5 and later, Yoast SEO and Rank Math, November 2026.

Yoast SEO and Rank Math add `inLanguage` to the `WebSite`, `WebPage` and `Article` pieces based on the site's language. With WPML or Polylang, the current language changes with the version: check the result on each language with the command from the “How to check” section. User reports mention values stuck on the main language, depending on the configuration.

To force the current language with Yoast SEO, in a small plugin or the child theme's `functions.php`:

```php
$setCurrentLanguage = function (array $data): array {
    $data['inLanguage'] = get_bloginfo('language');

    return $data;
};

add_filter('wpseo_schema_webpage', $setCurrentLanguage);
add_filter('wpseo_schema_article', $setCurrentLanguage);
```

`get_bloginfo('language')` returns the current language in `fr-FR` format, the one WordPress uses for the `lang` attribute. Yoast recommends a list of values on `WebSite` when the site exists in several languages: only do this if the `WebSite` piece keeps the same `@id` across all versions, with the `wpseo_schema_website` filter.

With Rank Math:

```php
add_filter('rank_math/json_ld', function (array $data, $jsonld): array {
    $language = get_bloginfo('language');

    foreach ($data as $key => $entity) {
        if (! is_array($entity) || ! isset($entity['@type'])) {
            continue;
        }

        $types = (array) $entity['@type'];

        if (array_intersect($types, ['WebPage', 'Article', 'BlogPosting', 'NewsArticle']) === []) {
            continue;
        }

        $data[$key]['inLanguage'] = $language;
    }

    return $data;
}, 99, 2);
```

Clear the page cache after the change.

### Shopify

Versions: Online Store 2.0 themes, Liquid, November 2026.

Recent themes write `<html lang="{{ request.locale.iso_code }}">`. Reuse the same value in the JSON-LD, for example in `snippets/json-ld-page.liquid` included from `layout/theme.liquid`:

```liquid
<script type="application/ld+json">
{
  "@context": "https://schema.org",
  "@type": "WebPage",
  "@id": {{ canonical_url | append: '#webpage' | json }},
  "url": {{ canonical_url | json }},
  "name": {{ page_title | json }},
  "inLanguage": {{ request.locale.iso_code | json }}
}
</script>
```

`request.locale.iso_code` returns the language of the version being viewed (`fr`, `en`, `pt-BR`). If the theme or an app already generates a `Product`, do not add `inLanguage` to it: put it on the page.

### Drupal

Versions: Drupal 10 and 11, Schema.org Metatag module.

In `Configuration > Search and metadata > Metatag`, open the content type's configuration, in the matching Schema.org section (`WebPage`, `Article`), and fill in the language field, if one is offered for that type, with the `[node:langcode]` token. Otherwise, add the property in custom markup. With the Content Translation module, each translation produces its own value. Clear the caches (`drush cr`).

### Laravel

Versions: Laravel 11 to 13.

The default template already writes `<html lang="{{ str_replace('_', '-', app()->getLocale()) }}">`. Use the same expression for the JSON-LD, for example with the `spatie/schema-org` package:

```php
use Spatie\SchemaOrg\Schema;

$language = str_replace('_', '-', app()->getLocale());

$webPage = Schema::webPage()
    ->setProperty('@id', "{$canonicalUrl}#webpage")
    ->url($canonicalUrl)
    ->name($title)
    ->inLanguage($language);
```

Output it in the view with `{!! $webPage->toScript() !!}`. If the language comes from a URL prefix (Laravel Localization package or a custom middleware), check that `app()->setLocale()` is called before the view is rendered.

### Next.js

Versions: Next.js 15 and 16 (App Router).

With a `[locale]` segment (next-intl or custom routing), read the language from the page parameters:

```tsx
// app/[locale]/blog/[slug]/page.tsx
export default async function Page({ params }: { params: Promise<{ locale: string; slug: string }> }) {
  const { locale, slug } = await params;
  const url = `https://example.com/${locale}/blog/${slug}/`;

  const jsonLd = {
    '@context': 'https://schema.org',
    '@type': 'BlogPosting',
    '@id': `${url}#article`,
    url,
    headline: 'Cast iron teapot care guide',
    inLanguage: locale,
  };

  return (
    <script
      type="application/ld+json"
      dangerouslySetInnerHTML={{ __html: JSON.stringify(jsonLd).replace(/</g, '\\u003c') }}
    />
  );
}
```

Use the same value as in `<html lang={locale}>` in the `app/[locale]/layout.tsx` template. If your internal codes differ from BCP 47 codes (`gb` instead of `en-GB`), go through a mapping table shared by the HTML and the JSON-LD.

### Nuxt

Versions: Nuxt 3 and 4, Nuxt Schema.org and @nuxtjs/i18n modules.

Nuxt Schema.org reads the language from the site configuration, which the @nuxtjs/i18n integration updates according to the version being viewed. Check the output; to force the value on a page:

```ts
const { locale } = useI18n();

useSchemaOrg([
  defineWebPage({ inLanguage: locale.value }),
]);
```

### Astro

Versions: Astro 4 and later, built-in i18n routing.

`Astro.currentLocale` returns the route's language. Use it both in `<html lang={Astro.currentLocale}>` and in the JSON-LD object serialized with `JSON.stringify` in a `<script type="application/ld+json" set:html={...} />` tag.

### Other CMSs and platforms

Wix, Squarespace and Webflow generate their own markup; how they handle `inLanguage` on translated versions varies. Test each language with the command from the “How to check” section. In custom markup, write one value per language in the code field of each localized version, never a code shared by all of them.

## Common mistakes

- **Value hard-wired in the template** (`"inLanguage": "fr-FR"` everywhere): every translation announces French.
- **`inLanguage` on `Product` or `Organization`**: an unknown property for these types, ignored and flagged by the validator.
- **Inconsistent codes**: `en` in the HTML, `en-US` in the JSON-LD, `en-GB` in the `hreflang` annotations.
- **Made-up codes**: `en-UK` or `gb` instead of `en-GB`. See [use en-GB rather than en-UK](https://checklist-seo-geo.com/en/hreflang-regional-variants/use-en-gb-rather-than-en-uk).
- **List of languages on a `WebPage`**: a page has one language; the list only applies to `WebSite`.
- **Confusing `inLanguage` and `knowsLanguage`**: the content's language is not the language spoken by the company.

## Frequently asked questions

### Does Google use the inLanguage property to determine a page's language?

Google states that it determines a page's language from its visible content and that it does not use language information placed in the code, such as the lang attribute. Its rich result documentation does not make inLanguage required. The property mainly serves to keep structured data consistent with the page and to explicitly distinguish the language versions of the same content for tools that read JSON-LD.

### Can you put inLanguage on a Product?

No. In schema.org, inLanguage applies to creative works and content (CreativeWork and its subtypes such as WebPage or Article), to events and to a few other types, but not to Product, Offer, Organization or Person. For a translated product page, put inLanguage on the WebPage or ItemPage entity that presents the product, and connect the product to that page with the mainEntity property.

### Should inLanguage say fr or fr-FR?

Both are valid in the BCP 47 format schema.org expects. Use fr-FR if you distinguish regional variants, such as fr-FR and fr-CA, and fr if a single French version serves every country. What matters is consistency: the same value in the lang attribute of the html element, in inLanguage and in the page's hreflang annotations.

## Resources

- [schema.org: inLanguage](https://schema.org/inLanguage)
- [schema.org: availableLanguage](https://schema.org/availableLanguage) and [knowsLanguage](https://schema.org/knowsLanguage)
- [W3C: Choosing a language tag](https://www.w3.org/International/questions/qa-choosing-language-tags)
- [Google Search Central: Managing multi-regional and multilingual sites](https://developers.google.com/search/docs/specialty/international/managing-multi-regional-sites?hl=en)
- [Yoast: WebSite piece](https://developer.yoast.com/features/schema/pieces/website/) and [WebPage piece](https://developer.yoast.com/features/schema/pieces/webpage/)
- [Shopify: shop_locale object](https://shopify.dev/docs/api/liquid/objects/shop_locale)

Next steps: [translate name and description](https://checklist-seo-geo.com/en/multilingual-linking-schema/translate-name-description), [adapt url to the language](https://checklist-seo-geo.com/en/multilingual-linking-schema/adapt-url-language) and [set html lang on each page](https://checklist-seo-geo.com/en/development-accessibility-language/set-html-lang-each-page).
