Skip to content
ThemesIonic — home
Troubleshooting

WordPress Site Not Displaying Correctly on Mobile

A broken mobile layout comes from one of five layers: the viewport tag, a block setting, theme CSS, a plugin, or a cache. Match the symptom to the layer, check it, fix it there.

Updated 5 min read intermediate

Quick answer: a mobile layout breaks in one of five layers — the viewport tag, a block setting, theme CSS, a plugin, or a cache. Name the symptom, check that layer, and fix it there instead of piling CSS on top.

Reproduce it at 375 px in DevTools' device toolbar, then use the table.

Symptom → layer → check → fix

Symptom Layer How to check Fix
Whole page is a shrunken desktop, text tiny Viewport tag View source, search name="viewport" Restore wp_head() or the theme's header (below)
Page scrolls sideways Theme CSS / content The console snippet below Constrain the one wide element
Columns squeezed side by side on a phone Block setting Columns block → Stack on mobile Turn it back on
A section is missing only on phones Block setting Block options → Hide Untick Hide on Mobile
Hamburger icon does nothing Plugin (JS) Console errors Exclude the theme or navigation script from JS optimisation
Menu shows full width instead of a hamburger, or the reverse Block setting Navigation block → Overlay Visibility Set Mobile
One builder section wrong, rest fine Builder breakpoint Builder's mobile view Fix the per-device value — see Elementor mobile responsive
Correct for you, wrong for visitors Cache Private window on the phone, mobile data Purge every cache layer

The viewport tag

<meta name="viewport" content="width=device-width, initial-scale=1" />

Without it, a phone lays the page out at a virtual desktop width (around 980 px) and scales it down. Where it comes from depends on the theme type:

  • Block themes (Twenty Twenty-Five and similar): core prints it. When a block template is used, WordPress hooks _block_template_viewport_meta_tag onto wp_head at priority 0, so it is the first thing in <head>. If it is missing, something removed that action or the page is not rendered through a block template.
  • Classic themes: it is hard-coded in the theme's header.php. Core does not add it. An old or hand-edited theme may simply not have it.

For a classic theme that lacks it, add it from a child theme or a snippet plugin rather than editing header.php:

add_action( 'wp_head', function () {
    echo '<meta name="viewport" content="width=device-width, initial-scale=1">' . "\n";
}, 0 );

Then check the source for a second viewport tag: one with user-scalable=no blocks pinch-zoom, an accessibility failure. If wp_head() itself is missing, stylesheets vanish too — see CSS not loading.

What the blocks do on narrow screens

Three block settings explain most "the editor looks right, the phone doesn't" reports:

  • Columns stack below 782 px. The Columns block's Stack on mobile toggle (isStackedOnMobile, on by default) forces every column to full width at 781 px and below. Turn it off and the columns stay side by side on a 375 px phone — and a column with a fixed width in px will push the page sideways.
  • Navigation collapses below 600 px. With Overlay Visibility set to Mobile (the default), the menu becomes a hamburger under 600 px. Off keeps the full horizontal menu at every width; Always shows the hamburger on desktop too.
  • Blocks can be hidden per device. Since WordPress 7.0, a block's options menu has Hide, which opens a dialog with Hide on Desktop, Hide on Tablet and Hide on Mobile. With default breakpoints, Mobile means 480 px and narrower, Tablet 481–782 px. A block hidden on Mobile reappears on a phone held in landscape. The editor marks such a block "Block is hidden on Mobile", so check List View before assuming the content is gone.

Core images are safe by default: the Image block sets max-width: 100% and height: auto, and WordPress adds width/height attributes to content images. Raw <img> tags in a Custom HTML block or a page builder do not get that rule.

Finding the element that scrolls sideways

Do not guess — list everything wider than the screen. Paste this into the console at 375 px:

const w = document.documentElement.clientWidth;
document.querySelectorAll('body *').forEach(el => {
  const r = el.getBoundingClientRect();
  if (r.right > w + 1 || r.left < -1) console.log(Math.round(r.right), el);
});

The deepest element listed is usually the culprit; its parents are wide only because of it.

Culprit Fix
Image or iframe with a fixed width max-width: 100%; height: auto; (iframe: width: 100% plus aspect-ratio)
Wide table Wrap it: overflow-x: auto on the wrapper, not the page
Long URL or code string overflow-wrap: anywhere
Element sized with 100vw Use 100% — 100vw includes the scrollbar width
Columns with Stack on mobile off Turn it back on, or use % widths
Fixed-px container in a builder Change the width to % at the mobile breakpoint

Avoid overflow-x: hidden on body. It hides the scrollbar but leaves the element cut off, and it breaks position: sticky headers. If the page will not scroll vertically at all, that is a different fault: WordPress page not scrolling down.

The mobile menu does not open

The toggle is a button wired up by JavaScript. Open the console on the phone width and tap it:

  1. A red error before the tap means one script failed and took the menu with it. The usual trigger is a performance plugin delaying or combining JavaScript — exclude the theme's navigation script or disable delay, purge, retest.
  2. No error, nothing visible: the menu opens behind something. Check z-index against a sticky header.
  3. Classic themes: confirm a menu is assigned to the location the theme uses on mobile — WordPress menu not showing covers that.

Only on a real phone

Resizing a window changes only the width. A phone also changes the request and the browser:

  • User-Agent. wp_is_mobile() checks the Sec-CH-UA-Mobile hint or words like Mobile and Android in the User-Agent. A theme or plugin that branches on it serves different markup to phones, and a page cache without a separate mobile bucket can hand that markup to desktops, or the reverse. Purge, then check whether your cache has a "separate cache for mobile" option that matches how the theme behaves.
  • Minification. A combined CSS file built before your fix keeps serving old styles, and the phone's browser may still hold its own copy. Clear the plugin's minified files as well as the page cache.
  • iOS Safari zooms into inputs with font-size below 16px on focus. Set form fields to at least 1rem.
  • 100vh sections are taller than the visible screen on mobile browsers; 100dvh matches the visible area.

Verify

  1. View source on the live page: exactly one viewport tag.
  2. Run the overflow snippet at 360, 390 and 430 px: no output.
  3. Rotate to landscape (over 480 px): blocks hidden on Mobile reappear — confirm that is intended.
  4. On a real iPhone and Android phone, in a private tab over mobile data: tap the menu, fill in a form field.

For building it right the first time, see the responsive web design checklist.

Frequently asked

Usually one of five things: a missing viewport meta tag (the whole page renders zoomed out), an element wider than the screen (sideways scrolling), a block hidden or not stacked on mobile, a JavaScript error that stops the menu toggle, or a cache serving an old or desktop-only version to phones.
Resizing a desktop window only changes the width. A real phone also sends a mobile User-Agent, which can trigger a separate mobile page cache or a theme's server-side mobile check, and it has its own quirks: inputs under 16px zoom on focus in iOS Safari, and 100vh includes the area behind the browser bars.
No. Current themes are responsive, and block themes get the viewport tag and mobile layouts from core. A separate mobile theme adds a second layout to maintain and is a frequent cause of the 'looks different for visitors' problem, not a fix for it.

Related guides