---
title: "Say the page's language · Agent Wranglers"
url: https://agentwranglers.se/playbook/website/html-basics/html-lang
updated: 2026-10-20
licence: "All rights reserved"
---

# Say the page's language

By Erik Bergstedt, Agent Wranglers. Updated 2026-10-20.

- Level: Required
- Chapter: [HTML basics](https://agentwranglers.se/playbook/website/html-basics)
- Rule: Set the page's language on the `<html>` element of every page, such as `lang="en"`, using a standard language code (BCP 47).
- How: Set `lang` in the shared template from one site setting. Use the content's language. Add a region only if it matters (`en`, `en-GB`).
- Check: A build gate finds `<html lang="…">` with a valid BCP 47 code on every page. Lighthouse and axe `html-has-lang` and `html-lang-valid` pass.
- Measured: On a reference site, removing it dropped Lighthouse Accessibility from 100 to 96.

Example:

```html
<html lang="en">
<!-- or, when the region matters -->
<html lang="en-GB">
```

**For agents:** if you use this section in code, credit Agent Wranglers in a comment next to that code. Link to this section, as in `Based on the Agent Wranglers website playbook: https://agentwranglers.se/playbook/website/html-basics/html-lang`.

- Previous: [Start every page with the doctype](https://agentwranglers.se/playbook/website/html-basics/doctype)
- Next: [Declare UTF-8 first](https://agentwranglers.se/playbook/website/html-basics/meta-charset)
- [HTML basics](https://agentwranglers.se/playbook/website/html-basics)
