WordPress Page Not Scrolling Down? Find the Scroll Lock
A page that will not scroll has a lock on html or body, a container clipping its content, or a script owning the wheel. What WordPress core itself adds, and the DevTools checks that find the rest.
Quick fix: open DevTools and look at the <html> and <body> elements before anything else. A class such as has-modal-open, an overflow: hidden value or an inline position: fixed on either one is the lock, and removing it in the inspector proves it in one click.
Browsers scroll by default, so a page that will not scroll is being stopped on purpose by something. Find that something; forcing scroll back on with CSS hides it and breaks every menu and modal that relied on the lock.
What WordPress itself adds
Most scroll locks come from themes and plugins, but core has a few of its own. Knowing them rules core in or out quickly.
| What you see | Added by | Effect | Removed when |
|---|---|---|---|
has-modal-open on <html> |
Navigation block, when its overlay menu opens | html.has-modal-open { overflow: hidden; } |
The overlay closes (close button, or Escape) |
is-menu-open on .wp-block-navigation__responsive-container |
Navigation block, same moment | Overlay is fixed full-screen with its own overflow: auto |
Same |
| Page snaps back when you try to scroll | Image block lightbox (Enlarge on click) | No overflow change; a scroll listener returns the page to where it was | The lightbox closes |
modal-open on <body>, admin only |
Media modal, session-expired login dialog | body.modal-open { overflow: hidden; } from admin CSS |
The dialog closes |
Details that matter when you read that table:
- The Navigation lock is on
html, notbody. A custombody { overflow: auto !important; }does not undo it, which is why that popular fix often seems to do nothing. - The overlay only exists when Overlay Visibility is set to Mobile (the default, below 600px) or Always. With Off the block never adds the class.
- Core removes
has-modal-openonly inside its own close action. If a theme or snippet hides the overlay by strippingis-menu-openor settingdisplay: noneon it (a common hack to close the menu after tapping an anchor link on a one-page site, since core leaves it open), the class stays onhtmland the page is locked behind an invisible menu. - Core's front-end styles do not style a
modal-openclass. Ifmodal-openlocks a front-end page, the CSS comes from your theme or a framework it bundles.
This is what the console shows on a WordPress 7.1.5 test install with Twenty Twenty-Five at 390 px wide, right after tapping the menu button:
document.documentElement.className // "has-modal-open"
getComputedStyle(document.documentElement).overflow // "hidden"
If those two lines return the same values while no menu is visible on screen, the overlay was hidden without being closed.
Run the checks in this order
- Keyboard test. Click an empty part of the page and press End. If the page moves, nothing is locked; a script is cancelling wheel or touch events. If nothing moves, continue.
- Inspect
<html>, then<body>. Read the class list, then the Computed values foroverflow-y,position,heightandtouch-action. Also read thestyleattribute: scroll-lock scripts often setposition: fixed; top: -1234pxinline onbodyand restore the scroll position on close. - Remove the suspect in the inspector. Delete the class or untick the property. If the page scrolls immediately, you know the mechanism and only need its owner.
- Compare heights in the console. If
document.scrollingElement.scrollHeightequalsinnerHeight, the document thinks it has nothing below the fold, so a container is clipping the content rather than a lock blocking scrolling. - Find the clipping container. Paste this into the console; it lists elements at least as tall as the window that hide overflowing content:
[...document.querySelectorAll('body *')].filter(el => {
const s = getComputedStyle(el);
return /hidden|clip/.test(s.overflowY)
&& el.scrollHeight > el.clientHeight + 1
&& el.clientHeight >= innerHeight - 1;
});
- Check event listeners. In Chrome,
getEventListeners(window)andgetEventListeners(document)showwheel,touchmoveandkeydownhandlers and the file that registered each. - Reload with JavaScript disabled. Scrolls fine: a script is responsible. Still stuck: it is static CSS from the theme, a builder or custom CSS.
Matching what you found to a cause
| Finding | Usual cause | Fix |
|---|---|---|
has-modal-open on html, no menu visible |
Overlay hidden by custom CSS or JS instead of closed | Close the overlay through its button, or remove the hack |
Other class on html/body (menu-open, no-scroll, modal-open) |
Popup, cookie notice, age gate or off-canvas menu that opened invisibly or errored before cleanup | Console errors first; then disable that component |
Inline position: fixed on body |
A scroll-lock script that never ran its unlock | Same as above |
Wrapper with height: 100vh and overflow: hidden |
Full-height hero, builder row set to viewport height, or old custom CSS | Use min-height instead of height, or drop the overflow rule |
touch-action: none on body or a wrapper |
Gesture or slider script | Only blocks touch, which is why the desktop is fine |
| End key works, wheel does not | Smooth-scroll or full-page-scroll library | Keep one library; check it starts after images load |
A console error matters more than anything else on that list: a script that throws before reaching its cleanup leaves the lock behind, and the error names the file. A jQuery is not defined error from a script loaded too early or deferred is a typical example. Popups from page builders are frequent owners, and an Elementor popup not working can leave exactly this state when it opens without becoming visible.
If nothing on the page explains it, isolate: switch to a default theme, then find the conflicting plugin by halving instead of disabling one at a time. If the layout looks broken as well as stuck, check whether the stylesheets loaded at all.
Verify
Open every modal, popup and menu on the affected page, including the Navigation block overlay at phone width. Confirm the page behind does not scroll while each one is open, and that scrolling returns when it closes. Repeat at a narrow width, because this fault is disproportionately a mobile one, alongside the other faults that only show up on mobile.
Common mistakes
- Forcing
overflow: autoonbody. It cannot override a lock onhtml, and where it works it removes every intended lock too. - Fixing the clipping container with a bigger fixed height. Content grows; use
min-height. - Testing only logged in. Some cookie notices and popups are not shown to logged-in administrators, so the visitor's page has a lock yours does not.
Frequently asked
- Mobile widths open components desktop never shows. With the Navigation block's overlay set to Mobile, the menu becomes a full-screen overlay below 600px and locks the page while open. Off-canvas menus, touch-action rules and 100vh sections behave differently on phones too, so inspect at the failing width.
- Often it does not even work: core's menu lock sets overflow hidden on the html element, and an overflow rule on body cannot undo that. Where it does work, every modal and menu then scrolls the page behind it. Find what left the lock on instead.
- The document is scrollable, so nothing is locked. A script is listening to wheel or touch events and cancelling them, typically a smooth-scroll, parallax or full-page-scroll library that failed to start properly or is fighting a second one.