WordPress & PHP guides

How to Update PHP in WordPress and Know When to Roll Back

Author: Lucky Oleg | Published

To update PHP in WordPress, change the PHP version in your hosting account, then open Tools → Site Health → Info → Server in WordPress to verify it. Do this on a staging copy first. Repeat a task someone relies on, such as sending an enquiry or paying for an order. If the task worked before the switch and now fails, hold the live change. If it breaks on the live site, a switch back to a patched, compatible PHP version can recover it while keeping new orders and edits.

Find the setting and check what else it changes

Start in the live site’s Site Health screen. Write down the exact PHP version, including its last number, and the domain you checked. Then sign in to the hosting account separately. You will still need that login if WordPress stops opening. Without a login, the PHP Version Checker can read a public version clue if the server exposes one. A hidden version leaves the question open.

Where the site is hostedWhere to change PHPCheck before applying
cPanelOpen Software → MultiPHP Manager, tick the domain, choose a version and click Apply.Note whether the old setting was inherit or a specific branch. The host can restrict the menu, including the route back.
SiteGroundIn the site’s Site Tools → Devs → PHP Manager, use the pencil beside the PHP version.Check the staging site separately. Manually choosing a branch changes whether SiteGround automatically moves it to a newer version.
Hostinger hPanelOpen PHP Configuration in the website dashboard.The plan setting affects the WordPress sites on that plan. A staging subdomain on the same plan may change live PHP too. Get an independent environment first.
KinstaUnder Sites, select the site and environment, then Tools → PHP settings → Change.Use the single-site control and check the automatic-update setting. Restart PHP restarts the existing runtime.

If your host uses a different panel, WordPress.org’s update guide explains how to involve the provider. A useful request is, “Which sites would this change affect? Can you switch just staging, and which patched version could you put back if the live change fails?” Resist changing a server-wide default to fix one dashboard warning.

There are two different jobs a host might offer. A patch updates the last number within a branch. A branch change, such as PHP 8.3 to 8.4, can alter the way existing code runs. If the notice concerns an urgent security fix, ask the host about patching the current branch now. A vendor can backport a fix to an older package. Our October PHP security notice shows what to ask the host when the panel displays only the branch.

Pick a target and rehearse with the same site

Compare your installed WordPress version with the WordPress core compatibility table and check the PHP security support dates. If you’re leaving PHP 8.2, its upstream security support ends on 31 December 2026. Our recommended PHP version guide compares branches for WordPress and WooCommerce. A plugin’s minimum PHP requirement tells you the oldest branch its author allows. Check the developer’s release notes for the newer branch you want to use.

  1. Restore a backup on an isolated copy. Include the database, uploads, themes, plugins, must-use plugins and configuration. Sign in and open a recent edit or order there to verify the restore. Match the PHP branch, extensions and limits used by the live site.
  2. Make the copy safe to use. Restrict access. Use test payment credentials, capture mail in a test inbox and disconnect live fulfilment, CRM and accounting integrations before staging can send anything. Review scheduled jobs immediately, especially renewals. WooCommerce explains why even a test order can trigger downstream work.
  3. Establish what works on the old branch. If the new PHP needs a WordPress or plugin update first, apply and test that software change separately while the old branch still works. Use that tested combination for the comparison. A form that already failed on the old branch cannot tell you whether the switch broke it.
  4. Change only staging PHP and repeat the same work. Reload Site Health, capture the exact version and match each action to the site’s PHP error log at that time. If a system cron task launches PHP from a shell, verify that task’s interpreter too. The web and command-line versions can differ.

Our WordPress PHP Upgrade Readiness Checker can turn a Site Health report into a staging checklist. It cannot submit your form, exercise a custom snippet or certify that a payment arrived.

Test the action and its result

Pick tests around the job the site does. For a brochure site, complete the enquiry. For a members’ site, sign in as a regular member and open restricted content. For a shop, trace a single sandbox order far enough to see what the back office receives.

On stagingEvidence worth keeping
Submit a uniquely labelled enquiryThe expected entry exists and the test inbox or sandbox CRM received the matching message.
Save a draft in the block editor or Elementor, close it and reopen itThe edit persisted. Upload a small image if the team uses the media library. If larger files fail, compare the WordPress upload limits on both branches.
Complete checkout with the sandbox gatewayThe gateway reference matches the order, tax and delivery look right, the callback updates its status, and the test inbox receives the expected email. If it is missing, trace the WooCommerce order notification.
Let a scheduled job runThe job actually finished and produced the expected result. WooCommerce exposes the run and error log under Status → Scheduled Actions.

Use the same inputs on both branches and record the first step that differs. “Checkout failed” is hard to investigate. “The sandbox gateway recorded payment, but order 42 stayed pending after its callback” gives the developer a place to start. Check the gateway record before retrying a payment.

A PHP rollback on a disposable WordPress site

We set up WordPress 7.1 in WordPress Playground with a custom quote calculator on one page. Its shortcode passed an invalid rounding mode when calculating a quote. PHP 8.3 silently used the default in this situation. From PHP 8.4, the same call raises a ValueError.

With no change to WordPress, the theme or the calculator, we switched from PHP 8.3.37 to 8.4.28. The homepage still returned HTTP 200 with its usual content. The calculator, which had shown 48.13, now returned HTTP 500. On the new branch we created a draft post, then put the previous runtime back without restoring the database.

The homepage loaded on all four runs. The quote page failed on PHP 8.4, recovered on 8.3 and worked again on 8.4 after the calculator was fixed.
Four requests to the same calculator page on one disposable WordPress installation. Only the last run included a code change.

The quote returned to 48.13, and the draft post created after the switch was still there. Finally we changed the calculator to use the explicit half-up rounding mode and tried PHP 8.4.28 again. The page returned HTTP 200 and the same quote. This was a deliberately faulty shortcode on a local site with SQLite. No client installation, WooCommerce extension or payment gateway was part of the rehearsal.

Switch production with the fallback ready

Take a fresh backup and agree who can make the decision to switch back. Apply the same application versions you tested, then change the live PHP selector when someone can verify the result immediately. Leave the live database in place. Pushing the staging database would copy old orders, users and settings over the current ones.

When we moved sites on our own server from PHP 8.4 to 8.5, we began with simple sites, followed with more complex ones and left the stores until last.

Our hosted-site inventory is a separate check. On 10 November 2026, it covered 25 Elementor Pro sites, including 15 WooCommerce stores. A public response header reported PHP 8.5.12 on 24 of the sites. A header can identify the runtime a server reports. To find out whether a customer’s payment went through, check the order.

After the switch, confirm the version in the logged-in live dashboard, open a page that must run PHP, and repeat the agreed live checks. Keep test-mode credentials out of production. Follow the next genuine order or enquiry through both systems, then check the next scheduled renewal, backup or import at its due time. If a page still loads from cache while the admin screen fails, investigate the admin failure.

When to roll back, and what to preserve

Switch back promptly if a previously working critical action now consistently fails and the host has a patched fallback that still supports the installed code. Save the time, action, error and relevant order or request reference privately. If the issue affects money, pause the failing payment method or checkout while the shop reconciles pending orders with the gateway. Repeated payment attempts can complicate recovery.

Investigate before restoring anything if a plugin migration ran or the failure persists on both branches. Keep a fresh copy of the current database and account for orders, registrations and edits since the backup. For example, restoring a 10:00 shop backup at 10:15 would remove an order placed at 10:12, even if the payment still appears in the gateway. A developer and the site owner should agree how to preserve those records and reconcile external payments before restoring. Our WordPress critical error recovery guide explains how to identify a failing component when wp-admin is unavailable.

Monitor with an owner and a date if the only new symptom is a deprecation notice, the affected workflow still completes correctly and the message is confined to a private log. A warning shown to customers, sensitive information exposed on screen or an error repeated on every request changes that decision. If the host cannot supply a patched fallback, involve it directly and restrict the affected feature while it is repaired.

Once recovered, test the exact failed action again and record the fix needed before the next attempt. If responsibility is split between a developer and a hosting provider, our WordPress PHP update service describes the checks the two sides can agree on before changing the site.

Recommended tools for this guide

Useful info? Spread the Aloha:

Lucky Oleg

Lucky Oleg is the founder of Web Aloha, a web design & SEO agency helping businesses ride the digital wave. With years of experience in WordPress, technical SEO, and web performance, he writes about what actually works in the real world.