Mark up foreign-language passages so they are not mistaken for your main language

Wrap quotes or sections in another language with a lang attribute so AI parses them correctly.

Scan your site

What this signal tests

We look for paragraphs, blockquotes, or inline spans on your page whose text is in a different language from the rest of the document, and check that the surrounding HTML element carries its own lang attribute. For example, a French quotation inside an English article should sit inside an element with lang="fr".

Why it matters for your visibility in AI

AI systems break text into tokens differently depending on language, and they pick which embedding or translation model to apply based on declared language. When a French sentence appears inside an English page with no lang marker, the English pipeline tokenizes it as if it were misspelled English. The resulting embeddings drift, summaries garble the quote, and retrieval matches the wrong queries. The concrete consequence shows up in citations: an AI assistant asked about a French legal phrase you quoted may fail to attribute it to your page because the embedding it generated for your version no longer matches the embedding for the same phrase on a French-language source. Marking the switch fixes this with one attribute.

Pass criteria at a glance

Criterion Passes when
<=1% of blocks fail detector/markup parity.

How we test it

We extract every text block of forty characters or more, run a fast language detector across each block, and compare the detected language to the lang attribute inherited from the nearest ancestor element. When the detected language differs from the inherited language and no enclosing element supplies a corrective lang attribute, the block is flagged. Pages where fewer than one percent of blocks fail this parity check pass the signal.

Show technical detection method
For each text block >=40 chars, run fast language detector (cld3); if detected lang differs from ancestor effective lang AND no ancestor lang attribute, flag.

If your site fails: how to fix it

  1. Wrap foreign-language paragraphs in a block element with the appropriate lang attribute, for example <blockquote lang="fr"> for a French quotation embedded in an English article.
  2. For short inline foreign phrases, use a span with lang, for example <span lang="la">ad hoc</span>, so translation and pronunciation tools handle them correctly.
  3. In WordPress, add lang attributes directly in the block editor's HTML view, or use a plugin that supports per-block language metadata for multilingual content.
  4. In a static site generator, extend your Markdown renderer or shortcode library to accept a lang argument on blockquotes and inline spans without dropping back to raw HTML each time.
  5. Audit existing translations, quotations, and loanwords in your most-linked pages first - these are the passages most likely to be cited by AI assistants and benefit most from explicit marking.

Quick facts

MaturityESTABLISHED
Weightlow
CategoryContent Clarity

Primary sources

Related signals

Frequently asked questions

Do I need to mark every single foreign loanword?

No. Common loanwords like "café" or "déjà vu" that have entered English usage do not need marking. Reserve lang attributes for genuine passages in another language - full sentences, quotations, song lyrics, or technical terms still clearly belonging to their original language.

What about code samples - are those a different language?

Programming languages are not natural languages and do not take a lang attribute. Wrap code in pre and code elements instead. The lang attribute is reserved for human languages defined by BCP 47, so HTML, Python, or SQL snippets sit outside its scope.

How is this different from declaring the page language once on html?

The html lang attribute sets the default language for the whole document. The lang-of-parts signal covers exceptions to that default - the foreign quotes, names, and passages embedded inside it. Both work together: declare the page language once, then mark the deviations.

Run your own scan

Run a free scan and see how your site grades across all 155 AI-readiness signals.

Scan your site