WordPress PHP upgradeis to replace the version of the programming language in which your site runs on the server with a newer one. The current PHP is faster and receives a security patch; The site remaining in the out-of-support version remains vulnerable to known vulnerabilities. The risk of upgrading is that old plugins and themes may be incompatible with the new version. This risk is reduced to almost zero with preparation before the upgrade.

Find out your current PHP version

In the admin panel, in the Tools, Site Health, Information tab, under the Server heading, the PHP version is written. The Site Health screen also shows a warning if the version is outdated. In the hosting panel, the current version and the versions that can be selected are listed in the PHP selector section.

Check compatibility

Each plugin and theme page includes "PHP requirement" or the version it was tested on. Plugins that have not been updated for a long time are the biggest risk. Use this list to check:

  • Make note of any plugins that haven't received an update in the last year.
  • Verify that the license and updates for paid themes and plugins are active.
  • Also list the codes written in the functions.php file or custom plugins; these do not appear in any compatibility lists.
  • Make sure the WordPress kernel is up to date.

Prepare backup and test environment

Take a full backup of the files and database before upgrading. If your hosting offers a staging environment, create a copy of the site there and change the PHP version there first. To turn on error logging in the test environment, add the following lines to the wp-config.php file:

define( 'WP_DEBUG', true );
define( 'WP_DEBUG_LOG', true );
define( 'WP_DEBUG_DISPLAY', false );

With these settings, warnings and errors are written to the wp-content/debug.log file. After visiting the home page, a few internal pages, the form, search and any payment steps, look for the "Fatal error" or "Deprecated" lines in this file. Deprecated warnings do not break the site today, but may become errors in the next version.

Upgrade on live site

  1. Choose a time when traffic is low.
  2. Select the new version from the PHP selector in the hosting panel.
  3. Check that the required PHP plugins (mysqli, curl, gd or imagick, mbstring, intl) are also turned on in the new version.
  4. Clear the cache and test the main functions of the site.
  5. Watch the server error log for the first 48 hours.

Risk level in version jumps

TransitionRiskNotes
Within the same major release (8.2 to 8.3)LowMost current plugins work without problems
From 7.4 to 8.xHighFatal errors are common in older plugins
Jumping multiple versionsmedium-highTesting in an intermediate version makes it easier to find the problem

Example scenario

Consider a corporate site that has been running on PHP 7.4 for years. The hosting company announces that it will remove support for the old version. When switching to 8.2 in the test environment, the contact form plugin and an old slider code added to the theme give an error. The form plugin is updated, the slider code is replaced with an updated component, and only then the live site is upgraded. If a direct upgrade was done live, the site would show critical errors for hours. If you encounter a critical error WordPress critical error Our guide explains the first steps.

If the hosting company changes the version automatically

Some hosting companies automatically upgrade out-of-support PHP versions after a certain date. The site owner who misses the announcement email may find his site on the critical error screen in the morning. Follow your hosting company's announcements and do compatibility testing yourself before the mandatory upgrade date. This way, the upgrade takes place at a time of your choosing, in a backed-up and tested manner.

Common mistakes

  • Ignoring warnings: Deprecated lines are errors of the next upgrade.
  • Not testing custom code: Manually added code does not appear in compatibility lists.
  • Staying on the old version after the error: The return should be temporary, the problematic component should be fixed.

To try the PHP upgrade in a test environment and do it without breaking your site WordPress technical support You can get support from our page.

Which version of PHP should I use?

Select the most current version that has ongoing security support and is supported by your plugins. Versions that are out of support will no longer receive security patches.

Does upgrading PHP speed up the site?

Usually yes. New versions run the same code with fewer resources; the difference is especially felt on non-cache pages.

What should I do if the site crashes after the upgrade?

Go back to the previous version from the hosting panel, find the incompatible plugin from the error log, and repeat the upgrade after it is updated.