Skip to content
Updates and recovery Expert

How to Detect Broken Layouts After Updates

A plugin update can return 200 OK and still wreck a page. How to catch layout breaks with before and after screenshots that do not cry wolf.

How to Detect Broken Layouts After Updates

The update that hurts is rarely the one that throws a fatal error. A fatal error is loud: the site shows the critical error message, recovery mode sends an email, monitoring goes red. The one that hurts is the update after which every page still returns 200 OK, while the menu has dropped below the logo, the product gallery shows one giant image, or the checkout button sits under the cookie banner on mobile. Nothing alerts. The client finds it, usually on a Monday morning.

Catching that needs a different kind of check from uptime monitoring or an error log. Somebody has to look at the page, and on more than a few sites that somebody has to be a machine. This article covers how to set that up so it finds real breaks without burying you in false alarms. It is part of the series on updating WordPress safely at scale.

Step by step: detecting broken layouts after updates

Why layouts break when nothing errors

Most layout breaks after an update come from a short list of causes.

  • A theme or page builder update changes its CSS classes or markup, and custom CSS written against the old classes no longer matches anything.
  • A plugin starts loading its own stylesheet, or a newer version of a shared library, and it overrides your styles.
  • The theme carries an outdated copy of a WooCommerce template, so the new markup and the old template disagree. WooCommerce > Status lists these overrides.
  • An optimisation plugin serves combined and minified CSS built from the old files. Elementor’s generated CSS can be stale in the same way until you regenerate it under Elementor > Tools.
  • A JavaScript error in one plugin stops another plugin’s script from running, so a slider, a set of tabs or the mobile menu never starts.

The last one deserves attention, because a screenshot sees its effect but not its cause. Plan for both.

Which pages to check

Not every URL. Check one page per template, plus the pages that make money.

For a typical brochure site that is the home page, one content page built with the page builder, one blog post, the blog archive and the contact page. For a shop, add a category page, a simple and a variable product, the cart, and the checkout up to the point where it asks for payment details. If the site has a member area, a booking form or a product configurator, add the page it lives on. That comes to eight to twelve pages, and together they cover nearly every template an update can touch.

Check each at two widths. 375 pixels for a phone and 1440 for a desktop catch most problems. A tablet width adds cost and rarely finds anything the other two miss.

Taking screenshots you can compare

A visual comparison is only as good as its screenshots. If the before and after differ for reasons other than the update, you get noise, and after the third false alarm nobody looks any more. These are the things that make screenshots comparable.

  • Use the same browser, the same machine and the same viewport for both. Font rendering differs between operating systems enough to fail a strict comparison.
  • Take the before screenshot minutes before the update, not weeks before. Content changes, and a baseline from last month will differ for reasons that have nothing to do with the update.
  • Bypass or purge the page cache for the after screenshot, and rebuild combined CSS. Otherwise you compare the old page with itself and see no change at all.
  • Wait for web fonts to load and the network to go quiet, and scroll to the bottom before a full-page capture so lazy-loaded images actually load.
  • Switch off animations and transitions, and stop carousels on their first slide.
  • Set the consent cookie, or hide the banner, so it does not cover half of the mobile screenshot.

Mask what is supposed to change

Some regions change on every load: a date, a stock counter, a random testimonial, an Instagram feed, ads, a chat bubble. Mask them, so the comparison ignores those areas. The common tools support this. BackstopJS has hideSelectors and removeSelectors, and Playwright’s screenshot assertion takes a mask option. Mask by CSS selector rather than by coordinates, so the mask follows the element when the layout shifts a little.

Set a threshold that means something

A pixel comparison never returns exactly zero on a real site. Anti-aliasing alone moves a few pixels. So you set a threshold, and the right one depends on the page. As a starting point I flag a page when more than about half a percent of its pixels differ, then tune per page after a few rounds.

A percentage has a blind spot. On a long page, a broken header can stay under the threshold while being obviously wrong to anyone who opens the site. Look at where the differences are as well as how many: a cluster in the header or above the fold matters more than scattered pixels across the footer. Some teams compare the visible first screen separately from the full page for exactly this reason, and I think that is worth the extra screenshot.

Show the result as the before image, the after image and a diff with the changed areas highlighted. A person can judge that in five seconds. A number on its own says nothing.

Add the checks a screenshot cannot do

Pair the visual check with a few functional ones on the same pages.

  • The HTTP status of every checked page, and the absence of the critical error message in the HTML.
  • Errors in the browser console. They catch the broken script that leaves a menu dead without changing a pixel until someone taps it.
  • New entries in the PHP error log since the update.
  • For a shop, adding a product to the cart and reaching the checkout.

With those four plus screenshots you catch most of what clients would otherwise report to you.

Doing it with a tool

BackstopJS and Playwright are the usual open source choices. Both are good, and both need a machine to run on, a list of URLs per site and someone to maintain the selectors when a client has the site redesigned. On ten sites that is a weekend of work. On a hundred it is a part-time job.

WP Octo builds the comparison into the update round: you choose the pages per site, it takes screenshots before and after, and a plugin that breaks the site is rolled back automatically and held at its previous version. The features page shows how that fits the rest of the round. When a break does reach a client, how to roll back a WordPress plugin update gets you back fast, and should WordPress updates run automatically covers when unattended updates are worth the risk.

Read also