How to Fix a Missing Viewport Meta Tag on Every Page

A page without a viewport meta tag tells mobile browsers to render it at a desktop width of about 980px and then shrink it down, so text is tiny and users have to pinch and zoom. This guide shows how to find every page missing the tag, add the correct tag to your shared templates, remove settings that block zooming, and confirm that each page now passes.

By Updated ⏱ 15-30 minutes🎯 Beginner● High impactOn-Page
Illustration: Viewport meta tag fix guide
ON-PAGE · FIX GUIDE Viewport meta tag IMPACTEFFORT TIME15-30 minutes LEVELBeginner

Why it matters

Google indexes the mobile version of your site, so a page that renders as a zoomed-out desktop layout on phones is the version Google evaluates. Missing viewports cause tiny text, tap targets that are too close together and horizontal scrolling. These problems raise bounce rates and hurt mobile Core Web Vitals such as layout shift and interaction responsiveness.

The audit counts how many of your crawled pages lack a valid viewport tag, so a single template that was missed, such as a landing page builder, a 404 page or a legacy blog, can fail the check across hundreds of URLs.

✕Before<head><title>ExampleCo</title></head>: no viewport tag, sothe page renders 980px wide and is✓After<head><meta charset="utf-8"><metaname="viewport"content="width=device-width,

What you need

Access to your site's theme, layout or head template (or CMS settings)
The list of failing URLs from your audit report
Chrome or another browser with DevTools
Optional: a terminal with curl for checking many URLs at once

Step-by-step fix

1

Group the failing URLs by template

Export the failing URLs from your audit and sort them by path pattern, for example /blog/, /lp/, /products/ or /help/. A missing viewport almost always comes from a template, not from individual pages. You will usually end up with 1-3 templates to fix, such as a landing page builder, a separate blog install or a custom error page.

Pro tip: If every URL fails, the problem is in your main layout file. If only one section fails, look for a separate template, subdomain or app that serves that section.
2

Confirm what the raw HTML actually contains

Check the server-delivered HTML, not the DevTools Elements panel. A viewport injected later by JavaScript may not be seen by crawlers. Use View Page Source (Ctrl+U / Cmd+Option+U) and search for viewport, or run curl against a sample of URLs.

Note any pages with no tag, two tags, or a tag that has a misspelled name attribute (for example name="view-port").

text
for u in https://example.com/ https://example.com/blog/post-1 https://example.com/lp/spring-offer; do
  echo "== $u"
  curl -sL -A "Mozilla/5.0 (Linux; Android 14) Mobile" "$u" | grep -io '<meta[^>]*name="viewport"[^>]*>' || echo "MISSING"
done
Pro tip: Send a mobile user agent with curl. Some sites serve different HTML to mobile devices, and that HTML is what Googlebot Smartphone sees.
3

Add the tag to the shared <head> template

Open the layout file that every page in the failing group uses and add the tag inside <head>, directly after <meta charset>. Use exactly width=device-width, initial-scale=1. Fixing the template once fixes every page built from it.

html
<head>
  <meta charset="utf-8">
  <meta name="viewport" content="width=device-width, initial-scale=1">
  <title>Example Co</title>
  <!-- rest of head -->
</head>
Pro tip: Use a single plain tag. Don't add `shrink-to-fit=no` or `minimal-ui`, which were old iOS workarounds that browsers no longer need.
4

Remove duplicates and zoom-blocking values

Search your theme, plugins and tag manager for any other viewport tags. Delete duplicates, because browsers apply only one and the result can be unpredictable. Remove these values if they are present:

  • user-scalable=no or user-scalable=0
  • maximum-scale=1 (or any value below 5)
  • a fixed width=1024 or similar pixel width

Blocking zoom fails WCAG 1.4.4 (Resize Text) and is flagged by accessibility and Lighthouse audits.

html
<!-- Wrong -->
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no">
<!-- Right -->
<meta name="viewport" content="width=device-width, initial-scale=1">
Pro tip: Teams often add `maximum-scale=1` to stop iOS from zooming into form fields. Instead, set input font-size to at least 16px, which prevents that zoom without disabling it for users.
5

Cover the outlier templates

Repeat the fix for every template you grouped in step 1. Common places the tag gets missed:

  • standalone landing page or funnel builders
  • the 404 and 500 error templates
  • a blog, docs or help center on a subdomain or a separate CMS
  • iframe-free embeds served as full pages, such as booking or careers pages
  • legacy static HTML files uploaded years ago
Pro tip: Hosted tools such as help desks and job boards usually include a viewport tag. If one doesn't, raise it with the vendor rather than trying to inject the tag through a tag manager.
6

Fix layout breakage the tag exposes

Once the viewport is set, pages built with fixed pixel widths may scroll sideways on phones. Look for elements wider than the screen, such as tables, images and containers with width: 1200px, and make them fluid. Run the snippet below in the DevTools console on a mobile-sized viewport to list the elements that overflow.

javascript
[...document.querySelectorAll('*')].filter(el => el.getBoundingClientRect().right > document.documentElement.clientWidth + 1).forEach(el => console.log(el));
Pro tip: A quick CSS safety net: img, video, iframe { max-width: 100%; height: auto; } plus overflow-x: auto on wide tables.
7

Clear caches and re-test the results

Purge your page cache and CDN cache, then repeat the curl check from step 2 on several URLs from each template. Open a few pages in Chrome DevTools device mode (Ctrl+Shift+M) and confirm that text is readable without zooming and that there is no horizontal scroll. Finally, re-run the audit and confirm that the count of failing pages is zero.

text
curl -sL -A "Mozilla/5.0 (Linux; Android 14) Mobile" https://example.com/lp/spring-offer | grep -ic 'name="viewport"'
# Expected output: 1
Pro tip: An output of 2 or more means there is still a duplicate tag. Track down the second source, which is often a plugin or a tag manager.

Platform-specific notes

WordPress

Most themes output the viewport in header.php, and block themes get it automatically from WordPress core. SEO plugins such as Yoast and Rank Math do not manage it. If the tag is missing, edit header.php in a child theme (Appearance → Theme File Editor) and add it inside <head>, or use a header-code plugin such as WPCode (Code Snippets → Header & Footer → Header). Page builders that use 'blank canvas' templates sometimes drop it, so test those pages separately.

Shopify

Go to Online Store → Themes → … → Edit code → layout/theme.liquid and confirm the tag sits inside <head>. Also check any alternate layouts, such as layout/password.liquid or custom layouts referenced with {% layout 'name' %}, because each one has its own <head>.

Wix, Squarespace, Webflow

These platforms add a correct viewport tag automatically, and you can't remove it from their templates. If the audit still flags pages, look for a custom code injection (Wix: Settings → Custom Code, Webflow: Site settings → Custom code, Squarespace: Settings → Advanced → Code Injection) that adds a second or zoom-blocking viewport, and delete it.

Next.js

The App Router outputs width=device-width, initial-scale=1 by default. If you customize it, use `export const viewport: Viewport = { width: 'device-width', initialScale: 1 }` in app/layout.tsx and do not set maximumScale or userScalable. Don't put a viewport tag in metadata.other or a manual <head>. In the Pages Router, set it in pages/_app.js via next/head, not in _document.js.

Static sites and Nginx/Apache

The server can't add meta tags for you. The tag has to be in the HTML files or in your static site generator's base layout, such as _layouts/default.html (Jekyll), layouts/_default/baseof.html (Hugo) or src/layouts/Layout.astro (Astro). Rebuild and redeploy after editing.

Check that it worked

✅ How to verify

  • Re-run the audit and confirm that no pages are listed as missing a viewport meta tag.
  • Run curl with a mobile user agent on sample URLs from every template and confirm exactly one tag containing width=device-width.
  • Run Lighthouse in Chrome DevTools in Mobile mode and confirm there is no viewport warning.
  • Load the pages in DevTools device mode at 360px wide and confirm the text is readable without zooming and there is no horizontal scrollbar.

⚠️ Common mistakes

  • Adding the tag through Google Tag Manager or client-side JavaScript. It arrives after the browser has already laid out the page and may not be seen by crawlers.
  • Fixing only the homepage template while landing pages, error pages or a subdomain blog still use a separate head without the tag.
  • Including maximum-scale=1 or user-scalable=no, which blocks pinch-to-zoom and creates an accessibility failure.
  • Leaving two viewport tags, one from the theme and one from a plugin or code injection, with conflicting values.

Is this still an issue on your site? Run a free audit — ZORO checks this and 294 other SEO, AI-visibility, accessibility and security signals, with fixes for your platform.

Check my site free

FAQ

What is the correct viewport meta tag in 2026?

<meta name="viewport" content="width=device-width, initial-scale=1">, placed inside <head>. No other values are needed for a responsive site.

Does a missing viewport tag affect Google rankings?

Indirectly, yes. Google uses mobile-first indexing, so it evaluates the mobile rendering of your pages. Without a viewport the page renders zoomed out with unreadable text, which hurts usability, engagement and mobile page experience signals.

Should I use user-scalable=no to stop the page zooming on input fields?

No. It prevents users with low vision from zooming and fails WCAG 1.4.4. Set form input font-size to 16px or larger, which stops iOS from auto-zooming into fields.

Where did Google's Mobile-Friendly Test go?

Google retired the Mobile-Friendly Test and the Search Console Mobile Usability report in December 2023. Use Lighthouse in Chrome DevTools, the URL Inspection tool's rendered screenshot in Search Console, or a site audit that checks every page.