Seitenreport Seitenreport
International in TYPO3

HTML lang attribute missing or incorrect in TYPO3 fix

Determine the main language in the document. In TYPO3, you check language configuration and translation assignment.

Limit the findings in TYPO3

Check the html element of the active fluid layout per site language. A correct hreflang set does not replace the language marking there.

How to fix the issue in TYPO3

  1. Check the language identifier of the site language and the opening html element of the page layout used. In TYPO3 13.4, the appropriate identifier belongs to the respective language context; a separate Fluid or TypoScript override must not remove it. In the delivered HTML, for example, check lang="de" for the German version. hreflang references in the head do not replace this attribute.
  2. Set lang on the html element from the language of the actual content. Use valid values such as de or en-GB; passages in another language can have their own lang attribute.

Start with one affected page or template. Check its output before applying the correction to other pages.

Example of this specific finding

Illustrative control case: A German-lang document does not have a lang attribute on the html element. As a result, read-out software does not receive a reliable reference to the main language.

<html lang="de">
  <p>Deutschsprachiger Inhalt</p>
  <p lang="en">An English quotation.</p>
</html>

follow-up audit in TYPO3

Issue the correct document language; mark longer different language passages separately if necessary. Test each language version.

How to verify that the fix worked

German and English pages return their respective language values. Cookie or browser location settings must not make the declared language contradict the visible text.

Explore the underlying audit checks: The check catalogue explains the signals behind findings and links to examples with each check’s limitations.

Derogations and scope

long and hreflang perform different tasks. A correct document language does not replace the assignment of language URLs.

Reference: TYPO3 13.4 with EXT:seo. For other major versions and own extensions, responsibilities may differ; check the actually installed output.

Classify the general error

Definition, system-independent causes and further correction examples: Define the main language in the document

Configuration and test signal documentation

W3C: Specify the language of an HTML page

Related International Errors in TYPO3