Upgrade the PHP version on a WordPress site, and fix what breaks
Hosts nag about PHP because old versions stop getting security fixes: PHP 8.1 and everything before it no longer do. The upgrade itself is one click in the hosting panel. The work is in what the click breaks, which is usually one old plugin or theme, and in knowing how to put it back if it goes wrong.
What breaks
- A plugin or theme that uses a function removed in the new version: the site shows a white page or a fatal error naming the file.
- Deprecation warnings printed at the top of every page, which are harmless but ugly and mean the code needs updating.
- A payment or shipping extension that pinned an old library.
- Occasionally nothing at all, which is the common case for a site that is kept updated.
How to upgrade safely
- Update WordPress, every plugin and the theme first. Most compatibility problems are fixed in newer releases.
- Use a staging copy if your host offers one, and switch PHP there first.
- Go one major version at a time and reload the homepage, the admin, and a checkout or form after each.
- Keep the error log open; it names the exact file that fails.
- If something breaks and you cannot fix it in minutes, switch back. Nothing is lost by returning to the old version.
Where the switch is
- cPanel hosts (GoDaddy web hosting, Bluehost, HostGator, Namecheap, A2): Software, then MultiPHP Manager.
- SiteGround: Site Tools, then Devs, then PHP Manager.
- Kinsta: MyKinsta, then the site, then Tools, then PHP engine.
- WP Engine: User Portal, then the environment, then Utilities.
- Cloudways: the server, then Settings and Packages, then Packages.
- Hostinger: hPanel, then Advanced, then PHP Configuration.
If it already broke
Switch back to the old version to get the site up, then find the plugin that failed. If the error names a plugin, rename its folder over SFTP and try the new version again. If the failing code is your theme, it needs a developer. Our site-down fix covers exactly this: the site loads again on a supported PHP version, the plugin or theme at fault is updated, replaced or disabled with your OK, and the report says which.
Questions people ask
- Which version should I pick?
- The newest one your host offers that WordPress lists as fully supported. If a plugin blocks it, the plugin is the thing to replace.
- Will the upgrade make the site faster?
- Often noticeably. Each PHP generation has been faster than the last, and it costs nothing.
- My host did the upgrade for me and the site went white. Whose fault is it?
- Hosts force upgrades when a version loses support. The site broke because of a plugin or theme that was already out of date, and that is what has to be fixed.