---
title: "How to Update PHP in WordPress and Roll Back Safely"
description: "Change PHP in your hosting panel, verify it in WordPress and test what customers actually do. See when a runtime rollback can preserve new orders and edits."
canonical_url: "https://webaloha.co/update-php-in-wordpress/"
markdown_url: "https://webaloha.co/update-php-in-wordpress.md"
date_published: "2026-12-02T00:00:00.000Z"
date_modified: "2026-12-02T00:00:00.000Z"
author: "https://webaloha.co/authors/lucky-oleg/"
---
[WordPress & PHP guides](https://webaloha.co/wordpress/)

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

Author: [Lucky Oleg](https://webaloha.co/authors/lucky-oleg/) | Published Dec 2, 2026

**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.

 ![A hand reaches for a toggle on one of two green server modules joined by a cable.](https://webaloha.co/_astro/update-php-in-wordpress-cover.mWT8umd5_1R7RAi.webp?dpl=dpl_DrmCruovR5ERrm6ZjA2htQ2bJB2W)

## Find the setting and check what else it changes

Start in the live site’s [Site Health screen](https://wordpress.org/documentation/article/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](https://webaloha.co/tools/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 hosted | Where to change PHP | Check before applying |
| --- | --- | --- |
| [cPanel](https://docs.cpanel.net/cpanel/software/multiphp-manager-for-cpanel/) | Open **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. |
| [SiteGround](https://www.siteground.com/kb/what-is-managed-php) | In 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 hPanel](https://www.hostinger.com/support/1575755-how-to-change-the-php-version-of-your-hostinger-hosting-plan/) | Open **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. |
| [Kinsta](https://kinsta.com/docs/wordpress-hosting/php/wordpress-restart-update-php/) | Under **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](https://wordpress.org/support/update-php/) 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](https://webaloha.co/wordpress-compatibility-with-php-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](https://access.redhat.com/security/updates/backporting). Our [October PHP security notice](https://webaloha.co/php-security-update-october-2026/) 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](https://make.wordpress.org/core/handbook/references/php-compatibility-and-wordpress-versions/) and check the [PHP security support dates](https://www.php.net/supported-versions.php). If you’re leaving PHP 8.2, its [upstream security support ends on 31 December 2026](https://webaloha.co/php-8-2-end-of-life-wordpress/). Our [recommended PHP version guide](https://webaloha.co/recommended-php-version-for-wordpress/) 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](https://webaloha.co/php-extensions-for-wordpress/) 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](https://woocommerce.com/document/managing-orders/testing-orders/) 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](https://webaloha.co/tools/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 staging | Evidence worth keeping |
| --- | --- |
| Submit a uniquely labelled enquiry | The expected entry exists and the test inbox or sandbox CRM received the matching message. |
| Save a draft in the block editor or [Elementor](https://webaloha.co/elementor-and-php-compatibility/), close it and reopen it | The edit persisted. Upload a small image if the team uses the media library. If larger files fail, compare the [WordPress upload limits](https://webaloha.co/wordpress-upload-limit/) on both branches. |
| Complete checkout with the sandbox gateway | The 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](https://webaloha.co/woocommerce-order-confirmation-email-not-sending/). |
| Let a scheduled job run | The job actually finished and produced the expected result. WooCommerce exposes the run and error log under [Status → Scheduled Actions](https://woocommerce.com/document/understanding-the-woocommerce-system-status-report/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](https://developer.wordpress.org/playground/developers/local-development/wp-playground-cli/) 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](https://www.php.net/manual/en/function.round.php).

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.](https://webaloha.co/_astro/update-php-in-wordpress-rollback.DNPVxh8-.svg)

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](https://webaloha.co/wordpress-php-8-5-compatibility/), we began with simple sites, followed with more complex ones and left the stores until last.

Our [hosted-site inventory](https://webaloha.co/recommended-php-version-for-wordpress/#hosted-wordpress-sites) 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](https://webaloha.co/wordpress-critical-error-recovery/) 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](https://webaloha.co/wordpress-php-update-service/) describes the checks the two sides can agree on before changing the site.

## Frequently asked questions

My hosting panel only shows PHP 8.4. How do I know which patch is active?

Site Health can show the full runtime version. If you need a particular security fix, ask your host which upstream release or vendor package revision contains it and whether that revision is active on every server serving your domain. Some vendors backport fixes while keeping an older-looking version number.

Why does PHP still show the old version after I changed it?

Check the live hostname, the environment selected in the panel and the PHP version in a freshly loaded Site Health report. A shell command can use a different binary. If the logged-in site still reports the old version after the host's stated change period, ask which workers or servers received the change.

Do I have to upgrade PHP one version at a time?

A hosting selector can usually take you straight to a branch it offers. Check the WordPress and plugin requirements for the target and test the jump on staging. Very old sites may need an intermediate version on which you can update WordPress or replace a plugin first.

An order arrived after the backup. Can I keep it when I roll back PHP?

Yes, if the only change needed is switching the interpreter back. Leave the current database in place and check the order against its gateway record afterward. If a plugin also changed the database and a restore is proposed, preserve the current data first. Have the shop and developer reconcile new orders, payments, stock and refunds before replacing anything.

Should I run a test payment on my live store after switching PHP?

Use sandbox credentials on an isolated staging store for the rehearsal. On the live store, check that checkout is available and follow the next genuine order from gateway confirmation to its WooCommerce status. Do not switch live checkout into test mode or charge a card merely to complete a checklist.

Does switching back to the previous PHP version fix a broken plugin?

It can restore a feature that worked on the previous runtime if the code and database remain compatible. The plugin still needs a fix before you try the newer PHP again. Confirm that the fallback build has current security fixes and repeat the exact action that failed.

What if my host has already removed the old PHP version?

Ask whether the host has a patched, supported fallback compatible with the site. If an essential feature is broken, pause that feature while the responsible developer repairs it on staging. A WordPress backup cannot install a missing server runtime.

## Recommended tools for this guide

[![](https://webaloha.co/_astro/tool-php-checker.qad4DTpr_4jH2I.webp?dpl=dpl_DrmCruovR5ERrm6ZjA2htQ2bJB2W)

Online PHP Version Checker

](https://webaloha.co/tools/php-version-checker/)[![](https://webaloha.co/_astro/tool-wordpress-php-readiness.CWOsWIns_ZNHK1B.webp?dpl=dpl_DrmCruovR5ERrm6ZjA2htQ2bJB2W)

WordPress PHP Compatibility Checker

](https://webaloha.co/tools/wordpress-php-upgrade-readiness-checker/)

Useful info? Spread the Aloha:

[![Lucky Oleg](https://webaloha.co/_astro/lucky-oleg.EPOIIvwX_ZX2S03.webp?dpl=dpl_DrmCruovR5ERrm6ZjA2htQ2bJB2W)](https://webaloha.co/authors/lucky-oleg/)

[Lucky Oleg](https://webaloha.co/authors/lucky-oleg/)[](https://www.linkedin.com/in/luckyoleg/)

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.

## Related guides from Web Aloha

[![](https://webaloha.co/_astro/blog-php-version-wordpress.DgdEEZic_1RPQJS.webp?dpl=dpl_DrmCruovR5ERrm6ZjA2htQ2bJB2W)

Recommended PHP Version for WordPress (2026): 8.3, 8.4 or 8.5?

](https://webaloha.co/recommended-php-version-for-wordpress/)[![](https://webaloha.co/_astro/guide-wordpress-critical-error-recovery.CFXOxNn-_2kbnAd.webp?dpl=dpl_DrmCruovR5ERrm6ZjA2htQ2bJB2W)

Fix WordPress “There Has Been a Critical Error on This Website”

](https://webaloha.co/wordpress-critical-error-recovery/)[![](https://webaloha.co/_astro/blog-php-extensions.5RwdrHut_Z2rLIiI.webp?dpl=dpl_DrmCruovR5ERrm6ZjA2htQ2bJB2W)

PHP Extensions for WordPress: Required vs Recommended

](https://webaloha.co/php-extensions-for-wordpress/)
