How to Update PHP in WordPress: Check Your Version and Apply Security Updates
Updating WordPress never updates PHP. Check your version, back up, test on staging, switch at your host, confirm the build is patched and switch off the one setting CVE-2026-115560 needs.
To update PHP in WordPress, first check which PHP version your site runs (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 do it. 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 November 6, 2026: added CVE-2026-115560 and its mitigation, CISA's October 26 Known Exploited Vulnerabilities listing, when each PHP branch's security fixes end, and rollback advice for hosts like Hostinger that block downgrades.
After the PHP2Shell vulnerabilities of October 2026, three things matter. You need to run a supported PHP branch (as of November 6, 2026, that means 8.2 or newer; from January 1, 2027, 8.3 or newer). That branch needs to be a patched build that includes the October 21 security fixes. And until PHP ships a fix for CVE-2026-115560, a newer flaw those releases don't cover, one PHP setting should be switched off. 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. - As of November 2026, WordPress recommends PHP 8.3 or newer. PHP 7.4, 8.0 and 8.1 are past end of life (the PHP project released the PHP2Shell fixes for them only as source code), and 8.2 stops getting security fixes after December 31, 2026.
- Switching branches is a compatibility change. Back up and test on staging first, because old plugins and themes are what usually break. Some hosts, including Hostinger, don't let you switch back down after an upgrade.
- On shared and managed hosting, the host installs patched builds. Ask it directly about CVE-2026-109618 and CVE-2026-109619, and whether
session.upload_progress.enabledis off until CVE-2026-115560 is fixed. - Updating PHP does not update WordPress either. Keep WordPress current too: the separate wp2shell flaw was fixed in WordPress 6.9.5 and 7.0.2.
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: as of November 6, 2026, that is 8.3, 8.4 or 8.5.
| PHP branch | Upstream status as of November 6, 2026 | Security fixes end | Release with the PHP2Shell fixes |
|---|---|---|---|
| 8.5 | Active support | December 31, 2029 | 8.5.12 |
| 8.4 | Active support (security fixes only from January 1, 2027) | December 31, 2028 | 8.4.27 |
| 8.3 | Security fixes only | December 31, 2027 | 8.3.36 |
| 8.2 | Security fixes only (end of life after December 31, 2026) | December 31, 2026 | 8.2.35 |
| 8.1, 8.0, 7.4 | End of life | Already ended | Source-only backports; depends on your vendor |
The dates come from the PHP project's supported-versions table. For most WordPress sites, 8.3 or 8.4 is the practical target. It meets WordPress's recommendation and leaves room before the next forced move; WordPress's hosting handbook now suggests 8.4 or later for production sites. If you are on 8.2, move now, because its security support ends on December 31, 2026. If you are on 7.4 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. If that project is big enough to make you reconsider the platform, our Webflow vs WordPress comparison covers who does the upkeep on each.
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: look for MultiPHP Manager (or Select PHP Version on CloudLinux servers), choose the domain and the version, and apply.
- Plesk: in Websites & Domains, open the domain's PHP settings (labelled "PHP" in some versions), choose the version, and confirm. See Plesk's PHP settings documentation.
- Hostinger (hPanel): open the website's dashboard and find PHP Configuration. Hostinger's support article says you can upgrade an existing site to any higher version, but you can't downgrade except within the same login session, and versions below 8.2 are no longer offered. Test on staging before you switch.
- SiteGround: Site Tools → Devs → PHP Manager. If the site is on SiteGround's Managed PHP, choose to change the version manually first; 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. The patched packages for Debian, Ubuntu, Red Hat and AlmaLinux are listed in our PHP2Shell guide, 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 October 2026 security fixes. On hosts that track upstream releases, the version should be at least 8.2.35, 8.3.36, 8.4.27 or 8.5.12. On distribution packages, check the vendor's notice or package changelog for CVE-2026-109618 and CVE-2026-109619, because backported fixes often keep the old version number.
One more check: CVE-2026-115560
On October 23, 2026, the PHP project published a notice for CVE-2026-115560, a separate remote code execution flaw in session upload progress handling. The October 21 releases (8.2.35, 8.3.36, 8.4.27 and 8.5.12) don't fix it. PHP said the fix and full advisory would come with a later release, so check php.net for the current fixed version; as of November 6, 2026, we couldn't confirm that one has shipped. One analysis says the flaw is reachable only when an application switches session.serialize_handler to php at runtime, but the mitigation is cheap: set session.upload_progress.enabled=0 in php.ini or the PHP-FPM pool, or ask your host to, and restart every PHP worker. WordPress core doesn't use PHP sessions, so the setting rarely affects a WordPress site; a plugin that shows upload progress bars is the likely exception, so retest uploads afterwards. If you already applied the setting for PHP2Shell, keep it until PHP ships a fix. Our PHP2Shell explainer tracks the same advisory.
On shared hosting, ask:
"Is the PHP build serving my site patched for CVE-2026-109618 and CVE-2026-109619, and is
session.upload_progress.enabledset to 0 until CVE-2026-115560 is fixed?"
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, doesn't let you downgrade an existing site after an upgrade, except within the same login session, 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.
A short WordPress security checklist to finish
- PHP on a supported branch, with a patched build confirmed by your host or package changelog.
session.upload_progress.enabled=0until PHP releases a fix for CVE-2026-115560, confirmed by your host or inphpinfo().- WordPress core, 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. 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 November 2026, WordPress recommends PHP 8.3 or newer. WordPress 7.0 raised the minimum supported version to 7.4, but 7.4 is past end of life upstream, so the minimum is not a safe target.
Which PHP version should WordPress use in 2027?
8.3 or 8.4, or 8.5 if your plugins and theme support it. 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 you can't downgrade an existing site 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. The 2026 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, so check Dashboard → Updates as well as your PHP version.
My host says PHP 8.3, but not 8.3.36. Am I patched?
Ask. Hosts that build PHP from distribution packages may include the fixes without changing the version number. Get the answer in writing, naming both CVE IDs, and ask about the CVE-2026-115560 setting at the same time.
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 November 6, 2026, and we'll recheck it 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, and some of those pages could only be read as search summaries. The illustrations are original diagrams made for this article.
Sources
Accessed October 22, 2026. Sources marked "Added November 6, 2026" were checked on November 6, 2026, when the version table, Hostinger's downgrade rule and CVE-2026-115560 were also rechecked.
- WordPress.org: Requirements
- 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)
- 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
- WordPress Developer Resources: Debugging in WordPress
- PHP: Supported versions
- PHP: PHP security releases announcement, October 21, 2026
- Added November 6, 2026: The Hacker News, PHP warns of another unpatched flaw; Astra Security, CVE-2026-115560 advisory
- 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


