Technical

How to fix a missing mobile viewport tag

Without a viewport tag, a phone draws your page at desktop width and then shrinks the whole thing to fit. Text comes out too small to read, taps land on the wrong link, and Google indexes the mobile version of your site, so this is the version that counts.

What it is

The viewport meta tag tells a phone to render the page at the device’s own width instead of pretending to be a desktop. It is a single line in the page head.

Why it costs you

Google uses mobile-first indexing: it judges and ranks the mobile version of your page. A page with no viewport tag renders as a zoomed-out desktop layout, which fails Google’s mobile-friendly bar and drives visitors away in seconds. Most themes include the tag, so a missing one usually means a hand-built page or a stripped-down template.

How to fix it

Add this to the <head> of every page: <meta name="viewport" content="width=device-width, initial-scale=1">

  • WordPress / Shopify / Webflow: their themes ship with it; if it is missing, you are on a custom template. Add the line to the header file (header.php, theme.liquid, or the head-embed field).
  • Hand-coded: add the line to your shared head partial so every page gets it.

How to check your site

View source and look for name="viewport". On your phone, if the page loads zoomed out with tiny text, the tag is missing or wrong. Google’s Mobile-Friendly Test confirms it.

What this looks like in practice

A one-page hand-coded site looked fine on the founder’s laptop and unusable on a phone. Adding the single viewport line fixed the layout on every device at once.

Questions people ask

The tag is there but the page still is not mobile-friendly.
The tag is necessary, not sufficient. You also need a layout that uses relative widths rather than fixed pixels. See the mobile-friendly check.
Should initial-scale be anything other than 1?
No. width=device-width, initial-scale=1 is the standard; avoid disabling zoom, which hurts accessibility.

Does your site have this?

Check your site to see which pages phones cannot render properly.

See also

All SEO checks →