Set the lang attribute on <html> — Base44
Missing lang attribute means screen readers use the wrong pronunciation and Google may serve your page to the wrong language market.
Fixing this in Base44
No-code + AI app builder
Base44 generates reusable blocks — many fixes are applied by regenerating the affected block with clearer instructions. Paste the prompt below into your Base44 chat and the fix rolls out across the project in one pass.
Using a different tool? Pick your stack:
The prompt for Base44
Copy and paste this into your Base44 chat exactly as-is.
In Base44, regenerate the affected blocks with these exact instructions: Add lang attribute to HTML 1. Add lang="en" (or the correct language) to the <html> tag.
Why this matters
The lang attribute tells browsers, screen readers, and search engines which language the page is in. Without it, screen readers use the OS default (often wrong), and Google may misidentify the target market.
For multilingual sites, set lang correctly on each locale and use hreflang tags for alternates. This is how Google decides which version to serve for German-speaking users vs. English-speaking.
How to use this prompt in Base44
- 1. Open your Base44 project.
- 2. Copy the prompt above with the copy button.
- 3. Paste into the Base44 chat and send.
- 4. Review the diff, accept the changes, redeploy.
- 5. Verify the fix using the checklist below.
Common mistakes to avoid
- error_outlineLeaving the default `lang="en"` on a German site — Google serves English users.
- error_outlineForgetting to update lang when adding i18n support.
- error_outlineUsing `lang="en-US"` for a global English site — en-US is fine, but `en` is enough.
How to verify the fix worked
- check_circleView source — `<html lang="...">` matches your content language.
- check_circleLighthouse Accessibility → "HTML has a lang attribute" passes.
- check_circleGoogle Search Console → International Targeting report — matches your intent.
Frequently asked questions
Should I use en or en-US?expand_more
How do I handle multilingual pages?expand_more
Want all 34 prompts tailored to your Base44 site?
Pantra scans your site in 10 seconds, detects the stack, and generates the exact prompts that apply — only the ones you actually need.
Scan my siteRelated Base44 prompts
Add the viewport meta tag — Base44
Prompt to add the mobile-friendly viewport meta tag — required for Google mobile-first indexing.
TechnicalDeclare UTF-8 charset — Base44
Prompt to add <meta charset="utf-8"> at the top of <head> to avoid broken characters.
TechnicalEnable gzip or brotli compression — Base44
Prompt to turn on compression on your hosting so HTML, CSS, and JS transfer 5-10x faster.
TechnicalAdd a high-resolution favicon — Base44
Stack-specific prompt to add a favicon that shows up correctly in browser tabs and Google search results.