How to Update Your WordPress Site's PHP Version Safely: Compatibility Checks, Hosting Panel Steps and Fixes
Update your WordPress PHP version safely: check compatibility on staging, switch in hPanel or cPanel, re-enable extensions and fix anything that breaks.

On this page
- Why the PHP version matters
- Which PHP version should you use?
- Check your current PHP version
- Before you switch: a compatibility checklist
- Test on staging first
- How to switch the PHP version in your hosting panel
- PHP extensions and settings to check
- Test after switching
- If something breaks
- Make it part of regular maintenance
- Quick check: what PHP does your site run?
- When to get help
- FAQs
- Old PHP versions stop getting security fixes and newer plugins drop support for them, so plan an upgrade rather than waiting for your host to force one.
- Before switching, take a backup, update WordPress, plugins and theme, replace abandoned plugins and test the new version on staging; PHP Compatibility Checker is only a first pass.
- Switch in hPanel or cPanel, check that extensions such as mysqli, curl, mbstring, intl, zip and gd are enabled for the new version, test key pages and forms, and switch back if anything breaks.
To update your WordPress site's PHP version safely, first check the current version in Tools > Site Health > Info > Server, take a full backup, and update WordPress, your theme and plugins. Then test the new PHP version on a staging copy, switch it in your hosting panel (PHP Configuration in Hostinger's hPanel, or "Select PHP Version" or MultiPHP Manager in cPanel), make sure the PHP extensions your site needs are enabled, and test key pages, forms and checkout. If anything breaks, switch back; it usually takes effect immediately.
The switch itself is one click. The care is in the checks before and after, because the most likely casualty is an old plugin or a piece of custom code. Checking the PHP version is part of the first health check on my WordPress maintenance plans, and the steps below are the same ones to follow if you're doing it yourself.
Why the PHP version matters
- Security. Each PHP version gets security fixes for a limited time. After that, newly found holes in PHP itself stay open on your server.
- Compatibility. Plugin and theme developers gradually drop support for old PHP versions. A site stuck on old PHP eventually can't install the updates that fix its own security problems.
- Speed. Newer PHP versions generally run WordPress faster, at no cost. It's not a substitute for proper optimisation, but it helps.
- Your host will move you eventually. Hosts retire old versions and sometimes switch accounts automatically, with only an email warning. It's better to upgrade on your schedule than theirs.
Which PHP version should you use?
PHP versions get two years of active support followed by two years of security-only fixes. At the time of writing (October 2026), the picture looks like this; check the supported versions page on php.net for current dates.
| PHP version | Status at the time of writing | What to do |
|---|---|---|
| 7.4 and older | No security fixes for years | Upgrade as soon as possible, carefully |
| 8.0 and 8.1 | End of life, no security fixes | Plan an upgrade now |
| 8.2 | Security fixes only, ending at the end of 2026 | Move up in the next few months |
| 8.3 | Security fixes only, until the end of 2027 | A safe, widely supported choice |
| 8.4 | Actively supported | A good target if your plugins support it |
| 8.5 | Newest release | Check plugin and theme compatibility first |
The right target is the newest version your plugins, theme and any custom code are tested with. WordPress.org's requirements page lists the version it currently recommends.
An outdated PHP version can also hide newer WordPress and plugin releases from the dashboard; see WordPress update button missing.
Check your current PHP version
- In WordPress: Tools > Site Health > Info > Server shows the PHP version, memory limit and other server settings. The Status tab warns if your version is outdated.
- On a store: WooCommerce > Status shows the PHP version and flags settings that are too low.
- In your hosting panel: the PHP settings page shows the version for each website.
If you use WP-CLI, note that the command line can run a different PHP version from the website itself, so trust Site Health for what visitors' requests use.
Before you switch: a compatibility checklist
- Take a full backup of files and database; see the backup and restore guide.
- Update WordPress, the theme and every plugin. Outdated versions are the usual cause of PHP upgrade problems, and most developers fixed PHP 8 issues long ago.
- Look for abandoned plugins. On each plugin's WordPress.org page, check "Last updated" and "Tested up to". A plugin untouched for years is the first suspect, so find a replacement before the switch.
- Check premium licences. An expired licence can leave a premium theme or plugin on an old version that doesn't support new PHP.
- List custom code: a child theme's functions.php, custom plugins, code snippets and anything a past developer wrote. Bespoke code is the most likely to break, because nobody else has updated it.
- Check for ionCube. Some premium plugins ship encoded files that need the ionCube Loader, which must be available for the new PHP version.
- Run a scan as a first pass. The PHP Compatibility Checker plugin scans plugin and theme code for known problems. It's useful, but it can miss issues and flag harmless code, and may not cover the very newest PHP version, so treat it as a hint, not a verdict.
Test on staging first
The reliable test is to run the site on the new version. Create a staging copy, set the staging site to the new PHP version if your host lets you choose per site or subdomain, and switch on error logging there:
define( 'WP_DEBUG', true );
define( 'WP_DEBUG_LOG', true );
define( 'WP_DEBUG_DISPLAY', false );
Click through the important pages and features, then read wp-content/debug.log. "PHP Deprecated" lines are warnings about code that will break in a future version; note them, but they won't take the site down. "PHP Fatal error" lines will, and they name the plugin or theme file responsible. See staging sites explained for setting one up on popular hosts.
How to switch the PHP version in your hosting panel
Hostinger (hPanel)
At the time of writing, open the website from Websites, then go to Advanced > PHP Configuration. The PHP versions tab lets you pick a version, and separate tabs cover PHP extensions and PHP options such as memory_limit.
cPanel hosts
Many Indian shared hosts use cPanel, which offers one of two tools. "Select PHP Version" (on CloudLinux servers) sets the version for the account and has Extensions and Options tabs. "MultiPHP Manager" sets the version per domain, with "MultiPHP INI Editor" for settings. If you see both, ask your host which one actually applies.
Other hosts
Managed hosts usually have a PHP setting per site in their own dashboard, under a name like PHP Manager or PHP settings. If you can't find it, ask support to change it for you.
If you're several versions behind, moving up in steps, for example from 7.4 to 8.2 and then to 8.3 or 8.4, makes it easier to see which jump caused a problem.
PHP extensions and settings to check
A common surprise: on cPanel's "Select PHP Version", extensions are chosen per PHP version, so the new version may not have the extensions you had switched on for the old one. After switching, check these are enabled:
| Extension | What uses it | Sign it's missing |
|---|---|---|
| mysqli | WordPress's database connection | "Your PHP installation appears to be missing the MySQL extension" |
| curl and openssl | Updates, licence checks, payment gateways, APIs | Updates or payments fail, "cURL error" messages |
| mbstring and intl | Text handling, especially non-English text such as Hindi | Errors mentioning mb_ functions, garbled characters |
| zip | Installing updates, backup plugins | "Class ZipArchive not found", failed backups |
| gd or imagick | Resizing uploads and creating thumbnails | Images upload without thumbnails, upload errors |
| xml, dom and exif | Imports, feeds, image orientation | Import tools fail, rotated photos |
Also check settings, which can reset when you change version: memory_limit, max_execution_time, upload_max_filesize, post_max_size and max_input_vars. A low max_input_vars is a common reason large menus or page builder layouts stop saving. Memory problems are covered in fixing memory limit errors, and upload limits in increasing the WordPress upload size limit.
Test after switching
- The homepage and key page templates, on a phone and a desktop, while logged out
- Every contact form, and check the email actually arrives
- Logging in, the editor or page builder, and saving a page
- For stores: cart, checkout, a test payment and order emails
- Image uploads, backups and anything that talks to an outside service
- Tools > Site Health for new warnings
If something breaks
- Switch back to the previous PHP version in the hosting panel. The site should recover straight away.
- Read the error. The recovery mode email or the debug log names the failing file. Typical PHP 8 errors include "Call to undefined function create_function()", "Uncaught TypeError" and "Unsupported operand types", all signs of old code.
- Update, replace or fix the plugin, theme or snippet responsible, then try again on staging.
If the site shows "There has been a critical error" and you can't get in, fixing the critical error covers recovery mode and disabling plugins over File Manager.
Make it part of regular maintenance
PHP isn't a one-off job. Check the version every few months, alongside plugin audits and updates, so you're never more than one step behind. How to update WordPress safely covers the update routine that keeps a site ready for the next PHP version. If speed is the reason you're looking at PHP, the version is one of several server checks in WordPress speed optimization.
Quick check: what PHP does your site run?
- Open Tools > Site Health > Info > Server and note the PHP version.
- Compare it with the versions currently supported on php.net. A version that no longer gets security updates should be changed.
- Before switching, take a full backup and, if your host offers it, test the new version on a staging copy first.
When to get help
Get help when the site uses old plugins or a custom theme that may break on newer PHP, when your host has set a deadline, or when there is no staging copy. WordPress maintenance and support covers PHP upgrades tested on staging. You can also send the details through the contact form.
FAQs
Will updating PHP break my WordPress site?
Not if WordPress, your theme and plugins are current and there's no old custom code. Problems come from outdated or abandoned plugins and bespoke code. Test on staging first, and you can switch back in the hosting panel if something slips through.
Which PHP version is best for WordPress?
The newest version that is still supported and that your plugins and theme are tested with. At the time of writing, that's usually PHP 8.3 or 8.4. Check WordPress.org's requirements page and your plugins' details before choosing.
Can I go back to the old PHP version?
Yes. The hosting panel lets you switch back, and it usually takes effect immediately, unless your host has retired that version. Use it to get the site working again, then fix the cause rather than staying on old PHP.
Does changing PHP affect my content or database?
No. Your pages, posts, orders and settings stay in the database untouched. Only the code that runs the site is affected, which is why problems show up as errors rather than lost content.
Is the PHP Compatibility Checker plugin reliable?
It's a helpful first pass, but it reads code without running it, so it can miss real problems and flag harmless ones. A test on staging with error logging turned on is the more reliable check.
Need help with your website?
I'm a freelance WordPress developer building fast, SEO-friendly websites since 2020. Tell me what you need and I'll reply with a plan and a fixed quote, usually within 24 hours.


