WordPress runs on PHP, and the PHP version is chosen on the server, not in the site itself. Some sites run on a version that stopped receiving security fixes long ago, because nobody has changed it since the site was built. Changing the PHP version in cPanel takes a few clicks, but if a theme or plugin is not ready for the new version yet, the site can stop working.
This guide shows how to find out which version your site runs on, which one to pick and what to check before the change. Then you switch it in cPanel and check that everything works. If something breaks, you will know how to go back to the old version.
Why the PHP version matters
Every PHP version has a lifespan. According to php.net, a branch is fully supported for two years, then gets only fixes for critical security problems for two more years, and after that it is out of support. A site on a version that is out of support can be left exposed to holes that nobody will fix any more.
WordPress recommends that the host runs PHP 8.3 or a newer version. On its requirements page it admits that it still works with PHP 7.4, but adds that these old versions have reached their end of life and may expose the site to vulnerabilities.
The second reason is speed. In WordPress's words, PHP becomes more efficient with each new version, so the site may load faster. How much faster depends on the site and cannot be promised in advance.
The table shows what the php.net page says at the date of this guide. It changes, so open it before you choose.
| PHP version | Support according to php.net |
|---|---|
| 8.5 | Active support until 31 December 2027, security fixes until 31 December 2029 |
| 8.4 | Active support until 31 December 2026, security fixes until 31 December 2028 |
| 8.3 | Security fixes only, until 31 December 2027 |
| 8.2 | Security fixes only, until 31 December 2026 |
| 8.1 | Out of support since 31 December 2025 |
| 8.0 | Out of support since 26 November 2023 |
| 7.4 | Out of support since 28 November 2022 |
If you are not sure which one to pick, start with 8.3. It is the lowest version WordPress recommends, and according to the table it gets security fixes until 31 December 2027. Newer versions are supported for longer, but first check that everything on the site is ready for them.
How to find out which version your site runs on
The version is visible in the WordPress admin. Open Tools > Site Health, go to the Info tab and expand the Server section. The PHP version row shows the version the site runs on right now. In a Bulgarian admin the path is "Инструменти", "Състояние на сайта", "Информация" and "Сървър", and the row is called "Версия на PHP".
The same section also has the PHP limits, such as PHP memory limit and Upload max filesize. After the change they may differ, especially in Select PHP Version, where the settings are separate for each version, so write them down.
On the Status tab of the same page, WordPress may show a message such as "PHP Update Required" or "PHP Update Recommended" if the version is old. If it is 8.3 or higher, WordPress says you do not need to change it for now.
Before you touch anything, save the current state. The Info tab has a button "Copy site info to clipboard". Click it and paste the text into a file on your computer. It holds the WordPress and PHP versions, the server limits and the active plugins with their versions. After the change you do the same and compare the two files.
What to check before you change the version
WordPress itself works with new PHP versions, but it cannot know whether your themes and plugins are ready for them. The WordPress page on updating PHP says so too. That is why the check is yours, and it starts with updates.
First update WordPress itself. WordPress's compatibility table shows which PHP versions each WordPress version was tested with, and old versions were not tested with the newest PHP. Then update the theme and the plugins from Dashboard > Updates and check that the site works. Delete the themes and plugins you do not use. The less code there is, the fewer things can break.
Then go through the active plugins. The list with their versions is in Tools > Site Health > Info, in the Active Plugins section. For plugins from wordpress.org, open the page of each one and see when it was last updated, what the changelog says and whether the forum has complaints about the new PHP version. If a plugin has not been tested with the latest three major WordPress versions, the page itself shows it with a warning. Such a plugin is the first candidate for replacement.
The page also shows the lowest PHP version the plugin works with (in its code this is Requires PHP), but not the highest. "Tested up to" refers to the WordPress version, not PHP. Neither the plugin header nor readme.txt has a field for the highest PHP version tested, so the answer is in the changelog and the forum. For paid plugins and themes outside wordpress.org, read the vendor's changelog or ask them directly.
WordPress.org recommends the PHP Compatibility Checker plugin for checking. The plugin's own page, however, says it is no longer maintained, that it checks compatibility only up to PHP 8.0 and that it does not run the code, so it cannot see errors that appear while the site is running. For 8.3 and newer versions it does not help, so rely on the test below. If you have a developer, php.net describes the incompatible changes in every version, for example for PHP 8.4.
Make your own backup of the files and the database
A backup has two parts, and WordPress describes them separately. The files are the site's folder, mostly wp-content and wp-config.php. The database holds the pages, posts, comments and settings.
The quickest way is to download an archive of the site's folder from File Manager (Compress) and export the database from phpMyAdmin (Export, Quick method, SQL format). If your host has the Backup Wizard in cPanel, choose Back Up, then Partial Backup, and download Home Directory and MySQL Databases. The copy of the home directory also contains the mail, so it can be big.
Even if your host makes automatic backups, the WordPress guide advises you to have your own copy as well, and not rely only on the host, so download a fresh backup right before the change. You can also make a backup and run updates from WP Toolkit in cPanel, if you have it, as described in the WP Toolkit guide. Both copies are described step by step in the guide how to move a WordPress site to a new host without downtime.
How to change the PHP version in cPanel
In cPanel the setting is in one of two places, depending on the server. One is MultiPHP Manager. The other is Select PHP Version, which you find on servers with CloudLinux. Both are in the Software section, and the host may have hidden one or the other interface.
Before you click anything, write down which version is selected now. If the host has limited the choice, you may not be able to go back to the old version yourself.
MultiPHP Manager
- Open MultiPHP Manager in cPanel.
- In the list of domains, tick the site's domain.
- From the PHP Version menu, choose the new version. Versions the host recommends are marked "Recommended".
- Click Apply.
The list shows the domains, but not their aliases (parked domains). Each domain can have its own version, so if you have a copy of the site on a test subdomain, try the new version there first. If the domain uses PHP-FPM, its version changes together with the selected one.
If the new version is missing from the menu, it is either not installed on the server or not allowed for your account. Only the server administrator can add it, so ask your host. If "inherit" is selected, the domain uses the server's default version, which only the administrator sets. To decide it yourself, pick a specific version.
Select PHP Version
- Open Select PHP Version in the Software section.
- From the list of versions, choose the new one.
- Set it as current with the "Set as current" button.
- Open Extensions and compare which extensions are enabled for the old and the new version.
PHP extensions and settings are managed separately for each version, and changes are saved automatically. So enable a missing extension here, for the version you chose. The list also has "native". That is what CloudLinux calls the version installed by cPanel with EasyApache.
When the change is done, go back to Tools > Site Health > Info > Server and reload the page. The PHP version row should show the new version. If it shows the old one, check that you picked the right domain.
Check that the site works after the change
Go through the most important things in a private window, so you do not look at a cached page.
- The home page and two or three inner pages.
- The admin login and the Posts, Pages and Plugins screens.
- The contact form, by sending a test message and seeing whether it arrives.
- On a shop, adding a product to the cart and getting to the payment step.
To see the errors, turn on a log. Add the lines below to wp-config.php, above the line "That's all, stop editing!". They write the errors to a file outside the site's folder and do not show them to visitors. Replace YOUR_USERNAME with the username of your cPanel account.
// wp-config.php, above "That's all, stop editing!"
// Temporary, only for the test. Afterwards set WP_DEBUG back to false.
define( 'WP_DEBUG', true );
define( 'WP_DEBUG_LOG', '/home/YOUR_USERNAME/wp-errors.log' );
define( 'WP_DEBUG_DISPLAY', false );
@ini_set( 'display_errors', 0 );
Go around the site again and read the log. PHP creates the file at the first error. If it is not there after your tour, most likely there are no errors, or the username in the path is wrong. Without Terminal, open the file in File Manager, in the home folder.
# cPanel > Terminal
# The last 30 lines of the log.
tail -n 30 ~/wp-errors.log
# Serious errors only.
grep "Fatal error" ~/wp-errors.log | tail -n 10
The log has messages of different weight. "Deprecated" does not stop the site. PHP writes it for code that will not work in future versions. "Fatal error" stops the page, and that is what you look for. The line with it also holds the path to the file where the error happened. If the path contains wp-content/plugins/plugin-name, that plugin is the culprit.
Here is an example. The create_function() function was removed in PHP 8.0, so an old plugin that still calls it gives exactly this kind of error.
# A line from the log (one line, wrapped here to make it easier to read)
PHP Fatal error: Uncaught Error: Call to undefined function
create_function() in /home/user/public_html/wp-content/plugins/
plugin-name/a.php:88
How to go back to the old version
If the site breaks, the first thing is to put the old version back. Open the same interface, MultiPHP Manager or Select PHP Version, choose the version you wrote down and confirm. WordPress advises the same. Change the version back yourself or ask your host.
Then do not rush. The site works, and you have a log and you know which plugin is the cause. Update it, replace it or remove it, and try again with the new version. If you use a caching plugin, clear its cache after going back, so you do not see an old page with an error. If you cannot log in to the admin, rename the plugin's folder inside wp-content/plugins in File Manager and WordPress turns it off. With WP-CLI this takes a command, and the WP-CLI guide also shows how to get the admin back when a plugin has broken it. The WordPress documentation describes the same for all plugins at once, by renaming the plugins folder to plugins_old.
If something worse happens and you need to restore a backup, ask your host to put the old PHP version back first, and only then restore the files and the database. The WordPress page on updating PHP advises this too.
Checklist
- The PHP version the site runs on now is written down, and the information from Site Health is saved.
- WordPress, the theme and the plugins are updated, and the ones you do not need are deleted.
- For the important plugins, you checked when they were last updated and what their forum says about the new version.
- There is a fresh backup of the files and the database, downloaded to your computer.
- The new version is 8.3 or newer and is available in MultiPHP Manager or in Select PHP Version.
- An error log is on, and errors are not shown on the screen.
- The home page, inner pages, the admin login and the contact form have been checked.
- There is no Fatal error in the log.
-
WP_DEBUGis back tofalse, andwp-errors.logis deleted.
If you would rather not do it yourself
Not every site needs this right away. If you already run PHP 8.3 or newer, WordPress says you do not need to change it for now. The more up to date the plugins are, the less you risk when it is time for a new version.
If you would rather not keep track of this yourself, with WordPress maintenance we update the system, PHP and the database, wherever your server is hosted. Describe your site in the inquiry form.
Frequently asked questions
Why does the PHP version matter for a WordPress site?
According to php.net, each PHP branch is fully supported for two years, then gets only critical security fixes for two more years, and after that it is out of support. A site on an unsupported version can be left exposed to holes nobody will fix any more. In WordPress's words, PHP becomes more efficient with each new version, so the site may also load faster, though by how much cannot be promised in advance.
Which PHP version should I choose for WordPress?
WordPress recommends PHP 8.3 or newer. If you are unsure, start with 8.3, the lowest recommended version, which according to php.net gets security fixes until 31 December 2027. Newer versions are supported for longer, but first check that everything on the site is ready for them.
How do I see which PHP version my site runs on?
In wp-admin open Tools > Site Health, the Info tab and the Server section, where the PHP version row shows the current version. In a Bulgarian admin the path is "Инструменти", "Състояние на сайта", "Информация" and "Сървър", and the row is "Версия на PHP". Before the change, click "Copy site info to clipboard" and save the text to a file so you can compare afterwards.
How do I know whether my plugins work with the new PHP version?
Open each plugin's page on wordpress.org and see when it was last updated, what the changelog says and whether the forum has complaints about the new PHP version. The page shows the lowest PHP version the plugin works with, but not the highest, and "Tested up to" refers to WordPress. For paid plugins and themes, read the vendor's changelog or ask them directly.
Does PHP Compatibility Checker help with PHP 8.3?
No. According to its own page, the plugin is no longer maintained, checks compatibility only up to PHP 8.0 and does not run the code, so it cannot see errors that appear while the site is running. For 8.3 and newer, rely on testing the site itself with the error log turned on.
Where in cPanel do I change the PHP version?
In the Software section of cPanel, in MultiPHP Manager or, on servers with CloudLinux, in Select PHP Version. In MultiPHP Manager tick the domain, choose the version from the PHP Version menu and click Apply. In Select PHP Version extensions and settings are separate for each version, so after the switch compare which extensions are enabled under Extensions.
How do I tell whether something broke after changing PHP?
In a private window, go through the home page, a few inner pages, the admin login and the contact form, and for a shop the cart and payment. Turn on an error log in wp-config.php, written outside the site's folder, and look for "Fatal error", since "Deprecated" does not stop the site. The path in the error line, such as wp-content/plugins/ with a plugin's name, points to the culprit.
How do I go back to the old PHP version if the site breaks?
Open the same tool, MultiPHP Manager or Select PHP Version, choose the version you wrote down before the change and confirm. If you use a cache plugin, clear its cache so you do not see an old page with an error. If you also need to restore a backup, ask your host to put the old PHP version back first, and only then restore the files and the database.
Sources
- WordPress.org, Requirements
- WordPress.org, Update PHP
- WordPress, Site Health screen
- WordPress Core Handbook, PHP Compatibility and WordPress Versions
- WordPress, Debugging in WordPress
- WordPress, Common WordPress Errors
- WordPress, Backing Up Your Database
- WordPress, Backing Up Your WordPress Files
- WP-CLI, wp plugin deactivate
- WordPress Plugin Handbook, Header Requirements
- WordPress Plugin Handbook, How your readme.txt works
- WordPress.org, PHP Compatibility Checker
- PHP, Supported Versions
- PHP, Unsupported Branches
- PHP Manual, Error Handling Predefined Constants
- PHP Manual, create_function
- PHP Manual, Migrating from PHP 8.3.x to PHP 8.4.x
- cPanel, MultiPHP Manager for cPanel
- cPanel, Backup Wizard
- CloudLinux, CloudLinux Manager UI
- CloudLinux Blog, A New PHP Selector Interface