Should I Update WordPress or PHP First?

Answered by SiteHale — a managed WordPress SEO and site-health service that runs automated optimization and monitoring for WordPress site owners.

Should You Update WordPress or PHP First?

Your WordPress dashboard shows a yellow warning that your site is running an outdated version of PHP. Your host has emailed to say older PHP versions are being retired. Meanwhile WordPress core, a dozen plugins, and your theme all have updates waiting. Both need attention, and doing them in the wrong order could break the site. So should you update WordPress or PHP first?

In most cases, update WordPress first. That means WordPress core, your plugins, and your theme. Then change the PHP version.

Newer releases of WordPress, plugins, and themes are written to support newer PHP versions. Older releases often are not. If you jump to PHP 8.x while running a plugin last updated years ago, that plugin may call functions that no longer exist. The usual result is a white screen or a “There has been a critical error on this website” message.

Updating the software first means every component is as PHP-ready as it can be before the server changes underneath it. The PHP switch then becomes a much smaller event, and it is easier to diagnose if something does go wrong.

There is one important exception: a PHP version so old that current WordPress will not install on it. That case is covered below.

Why the Order Matters So Much

WordPress core is careful about backward compatibility. It keeps working on a range of PHP versions and raises its minimum requirement slowly. For example, WordPress 6.6 raised the minimum to PHP 7.2.24. Plugins and themes are where the real risk lives.

Each major PHP release removes or changes features that older code relied on. A few common problems:

  • PHP 8.0 turned many old warnings into fatal errors. It also removed functions like create_function() and each(), which older plugins still use.
  • PHP 8.1 and 8.2 deprecated dynamic properties and other patterns. This floods error logs and can expose deeper bugs.
  • Abandoned plugins never get these fixes, so they fail the moment PHP moves ahead of them.

If you update PHP first, every outdated component hits these changes at the same moment. You end up hunting through a broken site with no clear idea which piece failed.

If you update WordPress, plugins, and themes first, you pick up the compatibility fixes developers have already shipped. Any component that still has no update stands out as a likely problem. You can then replace it before you touch PHP, instead of discovering it after your site goes down.

A Safe Step-by-Step Update Process

  1. Take a full backup. Back up both the files and the database. Use your host’s backup tool or a plugin like UpdraftPlus. Confirm you can download or restore the backup.
  2. Use a staging site if you can. Many hosts offer one-click staging. Run the whole process there before touching the live site.
  3. Check Tools > Site Health. Note your current PHP version and any critical issues WordPress reports.
  4. Audit plugins and themes. Any plugin not updated in over a year, or marked as closed on WordPress.org, is a red flag. Find a maintained replacement now.
  5. Update plugins and themes first, then WordPress core. Test the site’s key pages and functions after each batch. Check forms, checkout, logins, and page builders.
  6. Turn on error logging. Add define(‘WP_DEBUG’, true);, define(‘WP_DEBUG_LOG’, true); and define(‘WP_DEBUG_DISPLAY’, false); to wp-config.php. Errors will then go to /wp-content/debug.log instead of appearing on screen.
  7. Change the PHP version. Do this in your hosting panel, for example cPanel’s MultiPHP Manager or your host’s PHP settings page. Move one major version at a time where practical.
  8. Test again and read the log. Browse the site, log into the dashboard, and check debug.log for fatal errors.

When to Flip the Order, and What to Do If Something Breaks

The exception is a server running PHP so old that it falls below the current WordPress minimum. In that case, WordPress will not offer you the newest release. You will need to alternate between the two updates:

  1. Update WordPress, plugins, and themes to the latest versions your current PHP allows.
  2. Raise PHP to a version that meets the newer WordPress requirement.
  3. Finish updating WordPress and plugins.
  4. Raise PHP again to a currently supported version.

If the site breaks after the PHP change, don’t panic:

  • Switch PHP back in your hosting panel. This usually restores the site within seconds.
  • Check debug.log or your server error log. The file path in the fatal error usually names the culprit, such as /wp-content/plugins/plugin-name/.
  • Disable the faulty plugin. Rename its folder via FTP or your host’s file manager, then switch PHP forward again.
  • Use Recovery Mode. WordPress emails the admin a recovery link after a fatal error, which lets you deactivate the plugin from the dashboard.

Once everything runs cleanly, set WP_DEBUG back to false. Make a note to review PHP versions at least once a year so you never face a multi-version jump again.

Does Your Site Have This Problem?

Every check in this article runs automatically on the sites we look after. You can run the same health checks on your own site in seconds with the free SiteHale plugin — no account, nothing transmitted anywhere. Or have us do it: we’ll crawl your site and send you a written report, free.

Get My Free Site Report

Proven on our own sites first

Every automation runs on our own sites before any client site

25+ years in IT

Built by a 25-year professional IT team

$49/mo flat

Everything included — no tiers, no upsells

Leave a Comment