How to Stop WordPress Updates From Breaking Your Live Site

How to Stop WordPress Updates From Breaking Your Live Site

WordPress updates breaking a site almost always comes down to one of three things: an update was applied straight to production without a test pass, a rollback was impossible because nothing was backed up, or the failure was silent and nobody noticed until a customer did. The fix is a repeatable routine: test on a copy, ship to live only after the test passes, and keep a rollback path that takes seconds, not hours. This guide walks through the mechanics of that routine for core, plugins and themes.

Why wordpress updates breaking site behaviour is usually a process failure

When a plugin update takes a site down, the code change is the trigger, but the cause is the lack of a gate between the update and the live traffic. WordPress itself gives you very little protection here. The auto-update system will happily replace plugin files in place, and if the new version throws a fatal error, PHP returns a 500 for every request that loads it. There is no built-in canary and no built-in rollback. You have to build both.

The other half of the problem is that some failures do not produce a visible error page. A theme update can change a template hierarchy, a plugin update can alter a database schema, and the site keeps serving pages that look fine while checkout is broken. That is why a real test pass has to include more than "does the homepage load".

Stage the update before it touches live

The first mechanical step is a staging environment that is a genuine copy of production: same WordPress version, same plugin and theme versions, same PHP version, and ideally a copy of the database. A staging site running a different PHP minor version will not reproduce the fatal error you are trying to catch. If your host offers a one-click staging clone, use it, but verify the PHP version matches before you trust the result.

On a server you control, the cleanest approach is a separate virtual host and database, populated from a production dump. Export with mysqldump, import into the staging database, then run a search and replace on the URL so the copy does not try to load assets from the live domain. Do the replace with a serialisation-aware tool, not a raw sed, because WordPress stores serialised arrays in options and post meta and a naive replace corrupts them. The WP-CLI command for this is wp search-replace:

wp search-replace 'https://example.com' 'https://staging.example.com' \
  --all-tables --precise --report-changed-only

The output lists each table it touched and the number of rows changed, which is your confirmation that the replace ran across the tables you expected. Copy wp-config.php across and change the database credentials, then confirm the staging site loads with the same theme and plugin set as live.

Run the update and test the things that actually break

Apply the core, plugin and theme updates on staging using the normal admin screens or wp plugin update --all and wp core update. Then check the things that a surface-level glance misses. Load the front page, a single post, an archive, a search result, the login page and the admin dashboard. Submit a test form and confirm the entry is stored. Run through a test checkout if you sell anything. Open the browser console and the PHP error log and look for warnings and deprecations, not just fatal errors, because a deprecation today becomes a fatal error on the next PHP upgrade.

Enable WP_DEBUG and WP_DEBUG_LOG on staging so PHP notices land in wp-content/debug.log instead of being swallowed. A plugin that throws a notice on every page load is a plugin that will break under load or on a newer PHP version. Catch it at staging.

If the update passes, note the exact versions you tested, then apply the same versions to production in a quiet window and watch the error log and the uptime check for the next few minutes. Do not batch a core update, a PHP version change and a plugin update into the same deploy. If something breaks, you will not know which change caused it.

Keep a rollback path that works under pressure

Rollback is where most sites fail, because the backup was never tested. Before any update reaches production, take a database dump and a copy of wp-content/plugins and wp-content/themes. Store them somewhere outside the web root. Confirm you can restore them, not just create them.

For plugin and theme updates specifically, the fastest rollback is to reinstall the previous version. The plugin repository keeps older versions available, and WP-CLI can install a specific version by number:

wp plugin install woocommerce --version=8.5.2 --force
wp plugin list --status=active

The first command replaces the plugin files with the version you specify. The second lists active plugins with their versions so you can confirm the downgrade took. The same pattern works for themes with wp theme install. This is much faster than restoring a whole site from backup, and it is the reason you should record the version number of every plugin before you update it.

For core, the equivalent is wp core update --version=6.4.3 to move back, or a restore of the database if the update ran schema changes. Core database changes are the risky part, so take the dump immediately before the core update, not the day before.

If a bad update has already taken the site down, the immediate move is to disable the offending plugin from the command line rather than through the admin, which is likely unreachable:

wp plugin deactivate plugin-slug --skip-plugins
wp plugin list --status=inactive

The --skip-plugins flag loads WP-CLI without loading the broken plugin, which is what lets the command run when the site itself is throwing a fatal error. Once the site is back, you can debug the plugin on staging and restore the previous version there.

Control auto-updates deliberately

WordPress allows auto-updates for core minor releases by default and lets you enable them per plugin and per theme. For a production site that matters, turn plugin and theme auto-updates off and apply updates on a schedule you control, after staging. Core minor and security releases are the exception where auto-update is usually worth keeping, because they close known vulnerabilities and rarely change behaviour. Major core releases should never auto-update on a site you have not tested.

You can set this in wp-config.php with AUTOMATIC_UPDATER_DISABLED set to true, which stops all auto-updates including core, or leave core minor updates on and disable plugin auto-updates from the plugins screen or with WP-CLI. Pick one policy and apply it consistently across every site you run, so you are never guessing which sites are auto-updating.

Next, take the site you are most worried about and do one full cycle this week: clone to staging, run the updates, check the error log, and practise the version-pinned rollback on staging so you know the commands work before you need them on live. The routine only pays off if you have run it once while nothing is on fire.

Related articles

Subscribe to our newsletter

Get the latest hosting tips, performance insights, and industry news.