How to Update Your PHP Version in WordPress (the RIGHT Way)

After 15+ years as a webmaster working with WordPress sites, I can‘t stress enough how important it is to keep your PHP version up-to-date.

Outdated versions of PHP can drag down the performance and security of your WordPress site without you even realizing it. That‘s why I always make sure to upgrade clients‘ PHP versions as one of the first steps in any site optimization project.

In this comprehensive guide, I’ll share everything you need to know as a WordPress site owner about updating your PHP version the right way.

Why You Should Definitely Update PHP

There are a few key reasons why you should keep your PHP version up-to-date if you want your WordPress site running smoothly:

Performance Improvements

Each new major PHP release includes under-the-hood performance enhancements. For example, PHP 7.4 is up to 30% faster than the previous PHP 7.3 in real-world benchmarks.

Upgrading PHP is one of the simplest ways to significantly improve WordPress speed and get those site loading times down.

Critical Security Fixes

Like any software, vulnerabilities are often discovered in PHP that can lead to potential exploits. According to WordPress statistics, 75% of WordPress sites still use an unsupported PHP version with known security flaws.

Upgrading to the latest supported PHP version ensures you have all the critical security patches. This helps keep your WordPress site locked down tight against vulnerabilities.

WordPress Requirements

At a minimum, WordPress requires PHP 7.4 or higher. Using an outdated PHP version can lead to all sorts of strange compatibility issues and errors.

I can‘t tell you how many times I‘ve seen obscure plugin conflicts or issues that were fixed simply by getting the site up to a supported PHP version.

Access to New Features

New PHP releases add helpful new functions, improvements, and modern coding capabilities. By upgrading, your WordPress plugins and themes can leverage these new features to offer you a faster, smoother experience.

Checking Your Current PHP Version

Before updating your PHP version, you first need to check what version you are currently running. Here are a couple easy ways to check:

Via WordPress Dashboard

The simplest way is use the Site Health tool located in your WordPress dashboard:

  1. Go to Tools → Site Health in your dashboard menu
  2. Click on the Info tab
  3. Scroll down and look for the PHP version listed under Server Information

This will display your current PHP version number even if you‘re unsure what your host is running.

Via phpinfo()

You can also find your PHP version by creating a simple PHP file:

  1. Using FTP or your host file manager, create a new file called phpinfo.php
  2. Add this code:
<?php phpinfo(); ?>
  1. Upload it to your WordPress site‘s document root folder
  2. Open the phpinfo.php file in your browser
  3. Scroll down to find the PHP Version section

This prints out all your server‘s PHP details including the exact version you have installed.

How to Update Your PHP Version in WordPress

Once you know your current PHP version, updating it is a breeze. The exact steps depend on your specific hosting environment:

Updating PHP on WP Engine

For users hosted on WP Engine like myself, updating PHP is a piece of cake.

Simply login to your WP Engine account dashboard, and:

  1. Click on your site name
  2. Click on the current PHP version displayed below the name
  3. Select either "Upgrade to latest PHP" or "Downgrade to legacy PHP"
  4. Click the "Change PHP Version" button to confirm

WP Engine will automatically handle switching PHP versions across your entire site. It can‘t get much easier than that!

Updating PHP on Bluehost

If your WordPress site is hosted on Bluehost, here is how to update your PHP:

  1. Login to cPanel and click on the "MultiPHP Manager" icon
  2. Select your domain name from the menu
  3. Choose your desired PHP version from the available options
  4. Click the Apply button to save your new PHP version

It may take up to 24 hours for the changes to fully take effect on your Bluehost server.

Updating PHP on SiteGround

SiteGround users can quickly update PHP like this:

  1. Access your cPanel dashboard
  2. Go to "PHP Settings" under the Software section
  3. Click the Edit button
  4. Select your new PHP version from the dropdown menu
  5. Click the Confirm button to apply the change

SiteGround will automatically activate your new PHP version and email confirmation when complete.

Updating PHP on HostGator

To upgrade your PHP version on HostGator:

  1. Go to cPanel → MultiPHP INI Editor
  2. Select your domain from the list
  3. Choose your desired PHP version
  4. Click the Apply button to complete the update

It can take HostGator‘s servers up to 24 hours to fully switch PHP versions across your account.

Updating PHP on Other Hosts

For hosts not covered above, check their documentation for PHP upgrade instructions. Most hosts make it easy to change versions directly in cPanel.

Don‘t hesitate to open a support ticket if you can‘t find PHP upgrade steps for your host. Their technical team can switch PHP versions on the backend for you.

Best Practices For Updating PHP

Over the years, I‘ve learned some best practices when it comes to upgrading PHP for WordPress:

Always Test Upgrades First

Make any PHP changes on a staging copy of your site before updating production. This allows you to catch any issues early before they impact visitors.

Update WordPress Core First

Ensure you are running the very latest WordPress version before beginning any PHP upgrade. This avoids potential conflicts.

Confirm Plugins & Themes Are Up-to-Date

Similarly, double check that all plugins and themes have been updated to their newest versions before touching PHP.

Backup Your Site

ALWAYS backup your site before making significant server-side changes like PHP upgrades. This gives you a rollback point just in case.

Upgrade PHP Incrementally

When possible, increment PHP versions gradually. For example, upgrade PHP 7.0 to 7.1 first before jumping to PHP 7.4. This minimizes compatibility risks.

Monitor Your Site Closely

Keep an extremely close eye on your site for any issues before, during, and after a PHP upgrade. Be prepared to downgrade if necessary.

Don‘t Forget to Downgrade if Issues Arise

If you do run into problems after upgrading PHP, revert back to a previous version. Work with your host to troubleshoot the issues before trying to upgrade again.

Stick to these tips and your PHP upgrades will be smooth sailing.

FAQs About Updating PHP for WordPress

Still have questions about keeping your PHP current? Here are answers to some common questions:

What is the latest PHP version supported by WordPress?

As of this writing, PHP 8.1 is the current stable PHP release available. However, WordPress only requires a minimum of PHP 7.4 or higher. I recommend using PHP 7.4 or later for best performance and compatibility.

How often should I plan to update PHP?

Ideally, you should update your PHP version whenever a new major version is released (e.g. when PHP 8.0 comes out). Minor point releases (like 7.4.1 to 7.4.2) usually just contain small security patches and can be done more selectively.

Can updating PHP break my WordPress site?

It‘s unlikely, but there is a small chance of minor issues arising from a PHP update. That‘s why testing on a staging site first and following WordPress best practices is so important. Occasionally, downgrading PHP temporarily can be required if something does break.

Will upgrading PHP really speed up my WordPress site?

In my experience, yes – newer PHP versions almost always contain under-the-hood optimizations that can improve WordPress performance. But upgrade benefits will vary based on your specific hosting environment and site configuration.

How long does it take for a PHP update to complete?

The actual change only takes seconds in most cases. However, it can take up to 24 hours for the new PHP version to fully propagate across all the servers that host your site. Some WordPress hosts may be able to upgrade PHP faster than others.

Is PHP 7.4 still supported and recommended?

Absolutely, PHP 7.4 is a solid version that is still fully supported and the minimum for WordPress. However, I recommend upgrading to PHP 8+ if possible for improved performance, compatibility, and to take advantage of new features.

Conclusion

Upgrading your PHP version is one of the best and easiest ways to unlock performance gains and security fixes for your WordPress site.

Use this guide to check your current PHP version and follow the step-by-step instructions to update PHP for your specific host. Stick to WordPress best practices and feel free to reach out to your web host for assistance whenever needed.

Keeping your site on a fast, secure, and modern PHP version is one of the most important things you can do as a website owner. Your future self will thank you!

Written by Jason Striegel

C/C++, Java, Python, Linux developer for 18 years, A-Tech enthusiast love to share some useful tech hacks.