
To update the PHP version of a WordPress site safely: check your current version in Tools → Site Health, take a full backup, update WordPress, plugins and themes first, test the new PHP version on a staging copy, then switch the live site in your hosting panel and check the key pages and the error log. Running a supported PHP version (currently 8.2 or newer, ideally 8.3) makes WordPress faster and keeps it receiving security fixes. This guide explains PHP support dates, how to switch in common panels, and how to fix errors after the upgrade.
- Old PHP versions no longer receive security patches; PHP 7.4 and 8.0 are long out of support.
- Newer PHP versions are noticeably faster for WordPress.
- Most problems come from old plugins or themes, not WordPress core.
- You can switch back to the previous version in seconds if something breaks.
Update PHP version WordPress: PHP version support
| Version | Status (late 2026) |
|---|---|
| 7.4 and older | End of life since 2022, no security fixes |
| 8.0 | End of life since November 2023 |
| 8.1 | End of life since December 2025 |
| 8.2 | Security fixes only, until December 2026 |
| 8.3 | Security fixes, until December 2027 |
| 8.4 | Active support |
Check the official PHP supported versions page for current dates. Use the newest version your plugins and theme support.
Step 1: Check your current version
- WordPress: Tools → Site Health → Info → Server → PHP version. Site Health also warns when your version is out of date.
- Hosting panel: cPanel "Select PHP Version" or "MultiPHP Manager"; Hostinger hPanel → Advanced → PHP Configuration.
- Command line:
php -v(note the CLI version can differ from the web version).
Step 2: Prepare
- Take a full backup of files and database. See our backup guide.
- Update WordPress core, all plugins and the theme to their latest versions.
- Delete plugins you do not use, and look for any that have not been updated in over a year; they are the most likely to break.
- Check that the required PHP extensions are enabled on the new version:
mysqli,curl,gdorimagick,mbstring,xml,zip,intl.
Step 3: Test on staging
Many hosts offer one-click staging. Switch the staging copy to the new PHP version, then test: home page, key landing pages, contact forms, login, page builder editing, and for stores, add to cart and checkout. Turn on debug logging on staging so it records warnings:
define( 'WP_DEBUG', true );
define( 'WP_DEBUG_LOG', true ); // writes to wp-content/debug.log
define( 'WP_DEBUG_DISPLAY', false ); // do not show errors on screen
Step 4: Switch the live site
- cPanel: Software → MultiPHP Manager → select the domain → choose the version → Apply. Some hosts use "Select PHP Version" (CloudLinux) instead, where you also tick extensions.
- Hostinger hPanel: Websites → Manage → Advanced → PHP Configuration → choose version → Update.
- VPS: install the new PHP-FPM version and point the site's pool or virtual host to it, then reload the web server.
Clear all caches (plugin, server, CDN) and check the site immediately.
Step 5: Fix common errors
| Error | Cause and fix |
|---|---|
| "There has been a critical error on this website" | A plugin or theme uses removed PHP functions. Check the error log or the recovery email; update or replace the plugin. See our critical error guide. |
Deprecated: warnings | Not fatal; the code still works but should be updated. Hide display with WP_DEBUG_DISPLAY false. |
Call to undefined function mysql_connect() | Very old code; the extension was removed in PHP 7. Replace the plugin or theme. |
Uncaught TypeError / ArgumentCountError | PHP 8 is stricter about types and arguments. Update the plugin, or ask the developer for a fix. |
| Images not resizing | GD or Imagick extension not enabled on the new version. |
If you cannot fix it quickly, switch back to the previous PHP version, which restores the site immediately, and fix the problem on staging.
Update PHP version WordPress: custom PHP sites
Non-WordPress PHP sites and frameworks need the same process. Check framework requirements (for example, current Laravel releases require PHP 8.2 or newer), run the test suite, and use a static analysis tool such as PHPCompatibility with PHP_CodeSniffer to find incompatible code before switching.
Update PHP version WordPress: frequently asked questions
Update PHP version: will updating PHP make my site faster?
Usually yes. Each major release has brought performance improvements, and newer versions use less memory per request.
Update PHP version: can updating PHP break my site?
It can if a plugin or theme is out of date. That is why you test on staging first and keep a backup.
How often should I update PHP?
Review it at least once a year, and move before your version reaches end of life.
Related guides: How to Move WordPress to a New Host Without Downtime, WordPress Security Hardening and How to Speed Up a WordPress Website.
Want us to handle it?
PHP upgrades with staging tests are part of our maintenance plans. Also see our maintenance checklist, or contact us.
Written by the ItsWebExpert team, a web design and development company in Karachi building websites, online stores and apps for businesses across Pakistan.
Ask a Question on WhatsApp