How to update PHP in WordPress

Posted on Jul 14, 2022

Learn how you can update the PHP version used by the WordPress website

Photo from Unsplash

PHP is the programming language used to build WordPress.

Using the latest stable PHP version supported by WordPress is important to improve your website performance and security.

But WordPress itself doesn’t control the PHP version it used. Rather, the server where you host your WordPress site is the one that sets the PHP version.

Whether you’re using a shared hosting or a dedicated server, you should be able to update your PHP version.

Do this before you update PHP version

The WordPress application is compatible with many PHP versions starting from PHP 5.6, but there’s no guarantee that the themes and plugins you used in your website are the same.

To prevent your website from breaking because of PHP update, there are a couple of steps you need to do before updating:

  • Back up your website. When something goes wrong and you don’t know how to fix it fast, the first thing you should do is to restore your website using a backup file. WordPress has many free backup plugins, and your host may have a backup plan available.
  • Install PHP Compatibility Checker. This plugin will read your themes and plugins code and see if there’s any issue with the latest PHP version available. Although it can’t detect runtime issues, it does help to make sure everything is ready for the update.

Once you have a backup file ready, it’s time to update your PHP version.

Update PHP version in Bluehost

To update your PHP version in Bluehost, you need to login to your Bluehost control panel first.

Inside the control panel, click the Hosting menu and then click cpanel in the submenu:

Scroll down until you see the programming section, and click the PHP Config menu:

You should be able to change your PHP version there. Once done, click Save Change.

Bluehost recently changed its user interface. If you can’t find the Hosting menu, then look for the Advanced tab from the navigation sidebar on the left.

Scroll down and look for the SOFTWARE section, then click on MultiPHP Manager.

Check the box besides the domain where you want the PHP version to change.

Select the PHP version you want to use, then click Apply as shown below:

For more information, you can visit Bluehost PHP Version Selection page.

Update PHP version in SiteGround

To update the PHP version in SiteGround, login to the SiteGround control panel first.

Select the Websites tab, then click the Site Tools menu under the website that you want to update:

Navigate to the DEVS > PHP Manager menu then find Manage PHP Settings.

Click the Edit icon and update your PHP version there:

Save your changes. Your PHP version should be updated.

Update PHP version in other hosts

If you’re not using Bluehost or SiteGround, then you can consult the WordPress resource page at GitHub here:

Update PHP for popular hostings

The page above contain links to the specific hosting companies, each showing you how to update the PHP version when you host your WordPress website there.

If you don’t find your hosting company on the list above, then you need to email its customer support and ask them how to change the PHP version.

Now you’ve learned how to update the PHP version used by your WordPress website. Nice work! 👍

Level up your programming skills

I'm sending out an occasional email with the latest programming tutorials. Drop your email in the box below and I'll send new stuff straight into your inbox!

No spam. Unsubscribe anytime.