Explore Bato Web Agency Webflow Certified Partner Profile Explore Bato Web Agency Webflow Certified Partner Profile

How do you find the element causing horizontal scroll in WordPress?

Illustration without a description Illustration without a description

Find WordPress horizontal scroll by inspecting the published page at the failing width and comparing every element’s bounding box with the document viewport. The first oversized component is the repair target; body overflow hidden only conceals it. Test outside the editor because theme and plugin styles may load only on the front end.

 

const width = document.documentElement.clientWidth;
const offenders = […document.querySelectorAll('body *')].filter((element) => {
const rect = element.getBoundingClientRect();
return rect.left < 0 || rect.right > width;
});
console.table(offenders);

 

Inspect each result’s computed width, min-width, margins, transform and positioning. Common WordPress sources include wide Table blocks, fixed image sizes, negative full-width block margins, plugin forms, sliders, cookie banners and page-builder sections. A parent may appear oversized only because one descendant establishes its minimum width.

 

Temporarily outline elements and disable suspicious rules. Check ::before and ::after on affected blocks because pseudo-elements do not appear separately in the query. Long URLs and preformatted code need wrapping or their own scroll container. Flex and grid children often need min-width zero.

 

Use the browser Network panel to verify which stylesheet provides the declaration. Customizer CSS, block Additional CSS, theme files, optimization plugins and page builders can all emit competing rules. Clear generated CSS and cache layers after editing, then confirm that the front end loads the new file.

 

Repeat the check on a real iPhone if Safari alone shows the problem. Rotate the phone and test text enlargement. Keep intentional horizontal scroll inside the table or carousel, and verify that keyboard focus and swipe can reach its hidden content without making the whole document wider.