How to Update PHP in WordPress: Check Your Version and Apply Security Updates
Updating WordPress never updates PHP. Check your version, test PHP 8.4 on staging and switch at your host: PHP 8.2 security support ends Dec 31, 2026.
To update PHP in WordPress, check your current version in Tools → Site Health → Info → Server, back up the site, test the new version on a staging copy, and then switch the version in your hosting control panel (or ask your host to). As of December 2026, choose PHP 8.4 for most sites, or 8.3 at minimum, on a build from PHP's November 19, 2026 security releases. WordPress itself does not update PHP: PHP is part of the server, so the change happens at your host, not in the WordPress dashboard.
Updated December 4, 2026: PHP's November 19 security releases (8.2.36, 8.3.37, 8.4.28 and 8.5.13) fix CVE-2026-115560, so the fix is now a PHP update; turning off session upload progress was only ever a stopgap. We also added where WordPress stands on the new PHP 8.6, the WordPress 7.1.5 security release, and the December 31, 2026 end of PHP 8.2 security support.
Three things matter now. You need to run a supported PHP branch: 8.2 or newer today, and 8.3 or newer from January 1, 2027, because PHP 8.2 gets no security fixes after December 31, 2026. That branch needs to be a current patched build: 8.2.36, 8.3.37, 8.4.28, 8.5.13 or later, or a vendor package with the same fixes. And it should be a version WordPress lists as compatible, which as of December 4, 2026 means 8.5 at most, not 8.6. This guide covers all three, with the checks that prevent a broken site.
Key points
- Updating WordPress, themes or plugins never changes the PHP version or patches PHP.
- Check your version in Site Health. The command-line
php -vcan report a different PHP than the one serving your site. - If your site is on PHP 8.2, plan the move now. Its security support ends on December 31, 2026. PHP 7.4, 8.0 and 8.1 are already past end of life (the PHP project released the PHP2Shell fixes for them only as source code).
- As of December 2026, WordPress recommends PHP 8.3 or newer, and its hosting handbook, written for hosting companies, recommends 8.4 or later for production sites. PHP 8.6.0 is out, but WordPress's compatibility table doesn't list it yet, so keep production sites on 8.3, 8.4 or 8.5.
- Switching branches is a compatibility change. Back up and test on staging first, because old plugins and themes are what usually break. Some hosts limit switching back down: Hostinger, for example, doesn't let sites that were on an older, deprecated version downgrade after an upgrade.
- On shared and managed hosting, the host installs patched builds. Ask it directly whether the PHP serving your site includes the November 19, 2026 fixes, including CVE-2026-115560.
- Updating PHP does not update WordPress either. Keep WordPress current too: as of December 4, 2026, the latest release is WordPress 7.1.5, a security release from November 18, 2026, and WordPress 7.2 is due on December 8.
Step 1: Check your PHP version
Use the method that reads the PHP actually serving your website.
| Method | Where | Notes |
|---|---|---|
| Site Health | WordPress admin → Tools → Site Health → Info → Server | Shows the PHP version and SAPI that run WordPress. The best first check. |
| Hosting control panel | cPanel, Plesk or your host's own dashboard | Shows the version configured for each domain. Useful when the WordPress admin is broken. |
A temporary phpinfo() file | Upload a file containing <?php phpinfo(); and open it in a browser | Shows the full build. Delete it straight away, because it exposes server details. |
php -v over SSH | A server terminal | Shows the command-line PHP, which can differ from the web PHP. Do not rely on it alone. |
Write down the version and the date. If your host uses distribution packages (common on VPS and dedicated servers), the version number may not tell you whether security fixes are included. Step 5 covers that.
Step 2: Decide which version to move to
Move to a branch that will keep getting security fixes for at least a year and that WordPress lists as compatible: as of December 4, 2026, that is 8.3, 8.4 or 8.5.
| PHP branch | Upstream status as of December 4, 2026 | Security fixes end | Current release (November 19, 2026) |
|---|---|---|---|
| 8.6 | Active support; not yet in WordPress's compatibility table | December 31, 2030 | 8.6.0 |
| 8.5 | Active support | December 31, 2029 | 8.5.13 |
| 8.4 | Active support (security fixes only from January 1, 2027) | December 31, 2028 | 8.4.28 |
| 8.3 | Security fixes only | December 31, 2027 | 8.3.37 |
| 8.2 | Security fixes only (end of life after December 31, 2026) | December 31, 2026 | 8.2.36 |
| 8.1, 8.0, 7.4 | End of life | Already ended | Source-only PHP2Shell backports; later fixes depend on your vendor |
The dates come from the PHP project's supported-versions table. For most WordPress sites, 8.4 is the practical target. It meets WordPress's recommendation of 8.3 or newer, matches the WordPress hosting handbook's advice of 8.4 or later for production sites, and gets security fixes until the end of 2028. 8.3 also works, but it already gets security fixes only, its support ends a year sooner, and the WordPress hosting handbook tells hosts to plan migrations for sites on 8.3 as well as 8.2. If you are on 8.2, move now, because its security support ends on December 31, 2026. If you are on 7.4, 8.0 or 8.1, treat the move as a project: those branches are out of upstream support, and themes or plugins written for them are the most likely to fail on 8.3 or 8.4. If that project is big enough to make you reconsider the platform, our Webflow vs WordPress comparison covers who does the upkeep on each.
What about PHP 8.6?
PHP 8.6.0 came out on November 19, 2026. As of December 4, 2026, WordPress's PHP compatibility table lists versions up to 8.5 and has no entry for 8.6. WordPress 7.1, the current release, is listed as compatible with PHP 7.4 through 8.5. The release candidate notes for WordPress 7.2, scheduled for December 8, 2026, mention "PHP 8.6 compatibility improvements", but that is not yet a compatibility listing. Your plugins and theme also need time to catch up. Keep production sites on 8.3, 8.4 or 8.5 for now, even if your host's menu already offers 8.6, and try 8.6 on a staging copy once WordPress lists it.
Step 3: Back up the site
Take a full backup of the files and the database before you change anything, and confirm that you can restore it. A backup you have never restored is a hope, not a plan. Many hosts include one-click backups. If yours does not, export the database and download the wp-content folder at minimum. On hosts that don't let you go back to an older PHP version, the staging test is your main protection: restoring a backup brings back your files and database, but it doesn't change the PHP version.
Step 4: Test on a staging copy
Create a staging copy of the site (most managed WordPress hosts offer this), switch the staging copy to the new PHP version, and then test:
- The home page, a blog post, and your most important landing pages.
- Every form, including the contact form, newsletter signup and checkout if you sell online.
- The WordPress admin: editing a post, uploading an image, saving settings.
- Any page that uses a page builder, a slider or a custom plugin.
Turn on debug logging on staging (WP_DEBUG_LOG) and read the log after testing. Deprecation notices are warnings; fatal errors are blockers. Update or replace any plugin or theme that produces them before you touch the live site. A plugin that has not been updated in years is a security risk in its own right, PHP2Shell or not.
Step 5: Switch the live site and confirm the patch
Where you make the change depends on your hosting. Menus change over time, so follow your host's current documentation where it differs.
- cPanel: open MultiPHP Manager (some hosts on CloudLinux use a "Select PHP Version" tool instead), select the checkbox for the domain, choose the version from the PHP Version menu, and click Apply. If the version you want isn't listed, the server doesn't have it installed or your account can't use it; see cPanel's MultiPHP Manager documentation.
- Plesk: in Websites & Domains, find the domain and click PHP, choose the version from the menu, and click OK. See Plesk's PHP settings documentation.
- Hostinger (hPanel): go to Websites, choose Manage site for the website, open PHP Configuration, select the version and click Update. Hostinger's support article says the choice applies to every website on the hosting plan (except sites built with Hostinger AI Builder), that Hostinger installs new patch releases for your chosen version automatically, and that versions below 8.2 are no longer offered. For sites that were on an older, deprecated version, it says you can upgrade to any higher version but can't downgrade except within the same login session. Test on staging before you switch.
- SiteGround: Site Tools → Devs → PHP Manager, then the pencil icon to change the PHP version. If the site is on SiteGround's Managed PHP, SiteGround already moves it to newer versions over time; to pick a version yourself, switch to changing it manually, and SiteGround then stops updating the version for you. See SiteGround's Managed PHP article.
- Managed WordPress hosts: most offer a PHP version selector in the site's dashboard. If you cannot find one, ask support to make the change.
- VPS or dedicated server: install the patched package or upstream release for your chosen branch, point the web server or PHP-FPM pool at it, and restart every PHP worker so none keeps running the old binary. If the site runs in containers, rebuild the image on a patched base and redeploy. Our PHP2Shell guide covers distribution packages in its section for server administrators.
Then confirm two things. First, Site Health shows the new version. That matters because Site Health reads the PHP that serves web requests, while php -v on the command line can show a different, already-updated binary. Second, the build includes the latest security fixes. On hosts that track upstream releases, the version should be at least 8.2.36, 8.3.37, 8.4.28 or 8.5.13. These November 19, 2026 security releases come after the October 21 releases that fixed the PHP2Shell flaws (CVE-2026-109618 and CVE-2026-109619), so they include those fixes too. On distribution packages, check the vendor's notice or package changelog for CVE-2026-115560 as well as the two PHP2Shell CVEs, because backported fixes often keep the old version number.
CVE-2026-115560 is fixed in the November 19 builds
On October 23, 2026, the PHP project published an informational advisory for CVE-2026-115560, a remote code execution flaw in session handling that the October 21 releases (8.2.35, 8.3.36, 8.4.27 and 8.5.12) didn't fix. PHP said it could only happen with an unusual setup: an application that switches session.serialize_handler to php at runtime, with session upload progress still enabled. As a stopgap, PHP suggested setting session.upload_progress.enabled=0 until the next regular release.
That release came on November 19, 2026. PHP's changelog lists the fix (GHSA-658j-r8rw-q6mx, "Session serializer mismatch can lead to remote code execution") in 8.2.36, 8.3.37, 8.4.28, 8.5.13 and 8.6.0. The same releases fixed several other flaws rated critical, including more session-handling flaws and a PHP-FPM request smuggling bug. So the fix for CVE-2026-115560 is the November 19 build, not the setting. If you turned the setting off earlier, you can leave it off: WordPress core doesn't use PHP sessions, though a plugin that shows upload progress bars may need it back on. Our PHP2Shell explainer covers the same advisory.
On shared hosting, ask:
"Is the PHP build serving my site at least 8.2.36, 8.3.37, 8.4.28 or 8.5.13, or a vendor build with the November 19, 2026 fixes, including CVE-2026-115560?"
Keep the answer with the date. Our explainer on what PHP2Shell is and who is affected has the background.
Step 6: Check the live site afterwards
- Repeat the staging tests on the live site.
- Submit a test form and confirm the message arrives.
- Check that your pages still return status 200 and that the sitemap still loads.
- Watch the error log for a day.
- If the site was exposed while unpatched, look for unknown admin users, recently changed files in the web root and unexpected scheduled tasks. For PHP2Shell, start from October 17, 2026, when AWS first saw exploitation attempts, not from the patch date. Exploitation is confirmed: on October 26, 2026, the US cybersecurity agency CISA added both CVE-2026-109618 and CVE-2026-109619 to its Known Exploited Vulnerabilities catalog.
- If the server ran unpatched PHP on the internet, change the database password in
wp-config.php, regenerate the WordPress salts and rotate any API keys stored on the server. The PHP2Shell flaws can leak server memory.

If something breaks
How you roll back depends on your host. Where the control panel still offers your previous version, as cPanel, Plesk and SiteGround's PHP Manager usually do, switch back there; that usually restores the site within a minute. Some hosts don't allow that. Hostinger, for example, says sites that were on an older, deprecated version can't be downgraded after an upgrade, except within the same login session, and no longer offers versions below 8.2, so if you notice the problem later, use the temporary .htaccess override Hostinger documents for an older version, or contact support. If you use the override, switch back to a supported version as soon as the fix is in. Restore the backup from Step 3 only if the site's files or database were damaged; a restore doesn't change the PHP version.
Then find the failing plugin or theme in the error log, and update, replace or remove it before you try again. Do not stay on an unsupported branch as a long-term fix. Rolling back buys time to fix the incompatibility. If you roll back to 8.2, the clock is short: it stops getting security fixes after December 31, 2026.
A short WordPress security checklist to finish
- PHP on a supported branch WordPress lists as compatible (8.3, 8.4 or 8.5), on a November 19, 2026 build or later, confirmed by your host or package changelog.
- WordPress core updated to 7.1.5 or later (Dashboard → Updates), themes and plugins updated, and unused plugins and themes deleted, not just deactivated.
- Admin accounts reviewed: remove old users, require strong unique passwords and two-factor sign-in.
- Backups running on a schedule, stored away from the server, and tested by restoring one.
- A named person responsible for the next security update, and a way for the host to reach them. Budget the hours too: see our website maintenance cost breakdown.
The last item is the one most sites lack. If nobody owns these updates on your site, it may be time to choose a setup with less to maintain. Our guide to WordPress alternatives compares the options by who maintains what, and our website migration checklist covers how to move without losing traffic. We make PolyDraft, which rebuilds sites on Astro; if you decide to rebuild instead of maintaining WordPress, see what a WordPress-to-Astro rebuild keeps and what it leaves behind.
Frequently asked questions
Can I update PHP from the WordPress dashboard?
No. WordPress can show you the version and may display a "PHP update recommended" notice, but the change happens in your hosting account or on the server.
Will updating PHP break my site?
It can if a plugin or theme uses code that newer PHP versions no longer accept. That is why you test on staging first. Well-maintained plugins usually support current PHP branches.
What PHP version does WordPress need?
As of December 2026, WordPress recommends PHP 8.3 or newer, and its hosting handbook, written for hosting companies, recommends 8.4 or later for production. WordPress 7.0 raised the minimum supported version to 7.4, and WordPress 7.1 keeps that minimum, but 7.4 is past end of life upstream, so the minimum is not a safe target.
Should I use PHP 8.6 with WordPress?
Not on a live site yet. PHP 8.6.0 was released on November 19, 2026, but as of December 4, 2026, WordPress's PHP compatibility table goes up to 8.5. The release candidate notes for WordPress 7.2, scheduled for December 8, 2026, mention PHP 8.6 compatibility improvements, but that is not the same as a compatibility listing. Test 8.6 on staging once WordPress lists it and your plugins support it.
Which PHP version should WordPress use in 2027?
8.4, or 8.3 or 8.5 if that suits your plugins and theme. PHP 8.2 stops receiving security fixes after December 31, 2026, and from January 1, 2027, 8.4 gets security fixes only, until the end of 2028. PHP 8.3's security support runs to December 31, 2027.
Can I switch back to an older PHP version if something breaks?
Often, but not everywhere. cPanel and Plesk usually let you choose the previous version again. Hostinger says sites that were on an older, deprecated version can't be downgraded after upgrading, except within the same login session. Test on staging and keep a backup you have restored at least once.
Do I also need to update WordPress?
Yes, separately. PHP and WordPress have their own security releases. As of December 4, 2026, the latest WordPress release, 7.1.5 from November 18, 2026, is a security release that lists 20 security fixes and hardening changes, and WordPress recommends updating immediately. The earlier wp2shell vulnerability was in WordPress core, is on CISA's list of known exploited vulnerabilities, and was fixed in WordPress 6.9.5 and 7.0.2. Check Dashboard → Updates as well as your PHP version.
My host says PHP 8.3, but not 8.3.37. Am I patched?
Ask. Hosts that build PHP from distribution packages may include the fixes without changing the version number, and some hosts, such as Hostinger, install patch releases for you automatically. Get the answer in writing, naming CVE-2026-115560 and the two PHP2Shell CVEs (CVE-2026-109618 and CVE-2026-109619).
Continue with the next task
- The vulnerability behind this guide: PHP2Shell explained
- Decide whether to keep maintaining WordPress: WordPress alternatives for business websites
- Plan a platform move safely: Website redesign SEO checklist
About this article. Control-panel names and menus vary by host and change over time, so follow your host's documentation where it differs. PHP support dates change on fixed schedules: the version table is correct as of December 4, 2026, and we'll recheck it after WordPress 7.2 ships and again in the first week of January 2027, when PHP 8.2 reaches end of life. Drafted by an AI agent from the sources below, checked by an automated QA script and a separate fact-check against those sources, and approved for publication by Vincent Chen. We didn't sign in to any hosting panel for this update: host steps come from each host's public documentation, rechecked on December 4, 2026. The illustrations are original diagrams made for this article.
Sources
First accessed October 22, 2026. Sources marked "Added November 6, 2026" were first used on November 6, 2026. The PHP, WordPress and hosting sources were rechecked on December 4, 2026, and sources marked "Added December 4, 2026" were first used then.
- WordPress.org: Requirements
- Added December 4, 2026: Make WordPress Core: PHP Compatibility and WordPress Versions
- Make WordPress Core: Dropping support for PHP 7.2 and 7.3
- Added November 6, 2026: Make WordPress Hosting: Server environment (PHP recommendation for production sites)
- Added December 4, 2026: WordPress: WordPress 7.1.5 release; Releases; WordPress 7.2 Release Candidate 1; WordPress 7.2 Release Candidate 4
- Hostinger: How to update PHP in WordPress
- Added November 6, 2026: Hostinger: How to change the PHP version of your Hostinger hosting plan
- Added November 6, 2026: SiteGround: What is Managed PHP service and how to enable it?; Plesk: PHP settings
- Added December 4, 2026: cPanel: MultiPHP Manager for cPanel
- WordPress Developer Resources: Debugging in WordPress
- PHP: Supported versions
- PHP: PHP security releases announcement, October 21, 2026
- Added December 4, 2026: PHP: News archive 2026 (October 23 informational advisory on session upload progress; November 19 security releases and PHP 8.6.0); PHP 8 ChangeLog; PHP on GitHub: php-src security advisories
- Added November 6, 2026: CISA: Known Exploited Vulnerabilities catalog
- Datadog Security Labs: PHP2Shell: detection, analysis and remediation
- AWS Security Blog: PHP2Shell exploitation prior to public disclosure
- Debian: security tracker for CVE-2026-109618; Ubuntu: USN-8948-1; Red Hat: RHSA-2026:87070
- WordPress: WordPress 7.0.2 release


