Mobile viewport: what the check tests and how to fix it

Passes when 80% of crawled pages have a non-empty meta viewport tag. It never reads the value, and it matters to phone users more than to agents.

Technical · Weight 0.5 in the w2agent Score

How common is it?

91% of 1223 measured sites where this check applied pass.

Latest audit of each site under rubric v3.1. Sites where the check did not apply or could not be measured (for example, no llms.txt for the llms.txt checks) are left out. A partial result does not count as a pass.

What this check tests

For each crawled page (the homepage plus a sample of same-site pages) the audit parses the served HTML and looks for <meta name="viewport"> with a content attribute that is not empty. The score is the share of crawled pages that have one, rounded.

  • Pass: 80 or more.
  • Fail: anything under 80, including a score above 0. This check has no partial result.

Nothing about the value is tested. content="width=device-width, initial-scale=1", content="width=600" and content="user-scalable=no" all count the same. The check also does not test whether your layout actually adapts to small screens. A tag added by script in the browser is not seen, because the audit reads the HTML as served.

Why it matters to agents

The viewport meta tag is a hint to browsers on narrow screens. MDN explains that some mobile devices render a page in a virtual window wider than the screen and shrink the result to fit, which makes media queries for small widths ineffective, and that the viewport element mitigates this. The recommended setting it gives is width=device-width, which sets the viewport to match the device's width.

That is a rendering matter for people on phones. A tool that reads HTML text, and does not draw the page, never uses the tag. This page cites no source saying an AI assistant or agent reads it, so the link to agents is weak and indirect: it is part of basic page quality, and the weight is the lowest tier, 0.5. If you are choosing between fixes, put this after the checks that decide whether an agent can reach and read your content.

How to fix it

Add one tag to the <head> of every page template:

<meta name="viewport" content="width=device-width" />
  • MDN gives width=device-width as the recommended setting. MDN also says initial-scale=1 is a common addition that is usually unnecessary, because without it the browser picks the initial zoom itself. The audit accepts any non-empty value, so use the one that suits your layout.
  • Make sure the tag comes from the server-rendered HTML. In frameworks that use a head helper or a layout file, put it in the shared layout so no template misses it.
  • Avoid values that stop users zooming, such as user-scalable=no. This check does not penalise them, but MDN warns that disabling zoom prevents people with low vision from reading the page.
  • If a page uses a different template (an old blog theme, a landing page builder, an embedded docs site), open its source and confirm the tag is there. One uncovered section can pull the share below 80 on a small sample.
  • Check the HTML source of a few pages: curl -s https://example.com/ | grep -i viewport.

Other tags that belong in the same <head> are covered by UTF-8 charset and Canonical URLs.

Examples from measured sites

Up to 10 of the highest-scoring sites in each group, from recent audits. Failing includes partial results.

Passing

Failing or partial

Sources

Verified against these sources on

Does your site pass this check?

Check your own site →