How to Update PHP Version in WordPress (2024 Guide)

Hey there, WordPress users! If you‘re looking to give your website a performance and security boost, you‘re in the right place. Today we‘re diving deep into how to properly update the PHP version powering your WordPress site.

But first, why does PHP even matter for WordPress? PHP is the programming language that WordPress is built on. It handles all the heavy lifting behind the scenes, from processing requests to interacting with databases. So the PHP version your site is using can have a big impact on speed, stability, and functionality.

WordPress PHP Version Stats for 2024

According to WordPress.org, 78.7% of WordPress sites are running on PHP 7.4 or higher as of April 2024. This is great news for the community, as these modern PHP versions offer significant performance improvements and security enhancements over previous versions.

However, that still leaves over 20% of sites running on outdated, unsupported PHP versions that are vulnerable to unpatched security holes. If you‘re in that group, don‘t worry – updating is easier than you might think.

PHP Version% of WordPress Sites
8.210.3%
8.124.8%
8.031.2%
7.412.4%
< 7.421.3%

Source: WordPress Stats, April 2024

So what‘s the big deal with newer PHP versions anyway? PHP 8.1, released in 2021, delivered up to 23% better performance over PHP 7.4. And with PHP 8.2, WordPress sites saw another 10-15% boost on top of that.

Simply put, if your WordPress site is stuck on an old PHP version, you‘re missing out on free, easy performance wins. And you‘re putting your site at risk, as PHP versions only receive security updates for 2 years after their initial release.

How to Check Your WordPress Site‘s PHP Version

There are a few easy ways to check which PHP version your current WordPress site is using:

  1. In your WordPress dashboard, go to Tools > Site Health. The current PHP version is listed under the Server section on the Info tab.

  2. Install the free Display PHP Version plugin to see the PHP version right in your dashboard.

  3. Connect to your site via FTP and upload a file named phpinfo.php with this code:

    <?php phpinfo(); ?>

    Then view the file in your browser at yoursite.com/phpinfo.php.

Make note of your current PHP version. If it starts with 7.4, 8.0, 8.1, or 8.2, you‘re in good shape. But if it‘s 7.3 or lower, put updating PHP to the top of your to-do list.

Steps to Update PHP Version in WordPress

Now for the meat and potatoes – actually updating your WordPress site‘s PHP version. The process will vary a bit depending on your web host, but here‘s the general outline:

  1. Back up your full WordPress site, including files and database.
  2. Update all your plugins and themes to the latest versions.
  3. Thoroughly test your site on a staging server with the new PHP version. Look for any errors, conflicts, or strange behavior.
  4. Follow the instructions below for your specific hosting environment.
  5. Monitor your live site closely after updating for any issues.

As long as you take the proper precautions, updating PHP is a straightforward, low-risk task for most WordPress sites. But it always pays to have a full backup and carefully test beforehand.

Updating PHP Version on Bluehost

Here‘s how to update PHP for WordPress on Bluehost:

  1. Log in to your Bluehost control panel.
  2. Go to My Sites and click on Manage Site for the WordPress site you want to update.
  3. Under the Settings tab, find the PHP Version section and click on the Change link:
[Image: Bluehost cPanel PHP Version setting]
  1. Choose your desired PHP version from the dropdown (8.1 or 8.2 recommended as of 2024) and click Change:
[Image: Selecting PHP version in Bluehost]
  1. Confirm your selection and allow a few minutes for the update to take effect.

Updating PHP Version on SiteGround

Follow these steps to change the PHP version for WordPress on SiteGround:

  1. Log in to your SiteGround account and go to the Websites page.
  2. Click the Site Tools button for the WordPress site you‘re updating.
  3. Under the DevKit section, click PHP Manager.
  4. Select your desired PHP version in the Managed PHP Version section:
[Image: SiteGround PHP Version setting]
  1. Review the change and click Confirm. The new PHP version will be active in a few minutes.

Updating PHP Version on WP Engine

Thankfully, updating WordPress PHP versions on WP Engine is super simple:

  1. Log in to your WP Engine User Portal.
  2. Select your WordPress install under the Sites section.
  3. Go to Utilities > PHP Version:
[Image: WP Engine Portal PHP Version setting]
  1. Use the dropdown to select your new desired PHP version.
  2. Confirm the change and you‘re all set.

Using WP-CLI to Update PHP

For more technical users managing multiple WordPress sites, you can use the WP-CLI command line tool to update the PHP version.

First, make sure you have SSH access to your server. Then, run the following command to verify your current PHP version:

wp core version --extra

To update to a new PHP version, most managed WordPress hosts support the wp server php command:

wp server php 8.2

This will seamlessly update the PHP version without needing to log in to your hosting account. Perfect for bulk updates!

Frequently Asked Questions

Still have questions about updating PHP versions for WordPress? I‘ve got answers:

What happens if I don‘t update my WordPress PHP version?

Your site will still run (for now), but you‘ll be missing out on major performance and stability improvements. More importantly, your site will be vulnerable to unpatched security holes that attackers can exploit if you‘re running an unsupported PHP version.

Can updating PHP break my WordPress site?

It‘s possible, but unlikely. The key is to thoroughly test your WordPress site on a staging environment with the new PHP version first. Look for any plugin/theme conflicts or errors. If you do run into issues, revert back to the previous version and reach out to your host for support.

How often should I update my WordPress PHP version?

Check your PHP version quarterly and update to a new supported version as soon as it‘s stable and compatible with your WordPress setup. Don‘t wait until your PHP version is no longer supported to update.

What‘s the best PHP version for WordPress?

As of 2024, PHP 8.2 offers the best performance and security for WordPress sites. If you run into compatibility issues, PHP 8.1 is a good alternative with equivalent security support until 2024.

Key Takeaways

Phew, that was a lot of information! Let‘s recap the key points for updating PHP versions in WordPress:

  • Update to a supported PHP version to get the best performance, security, and compatibility for your WordPress site.
  • Check your current PHP version and back up your site before attempting any updates.
  • Follow your host‘s documentation or use WP-CLI to perform the actual PHP version update.
  • Thoroughly test your updated WordPress site for any plugin/theme conflicts or unexpected errors.
  • Keep an eye on PHP release cycles and plan to update versions regularly for the best long-term results.

You‘ve got this, intrepid WordPress user! Updating PHP may seem intimidating at first, but it‘s one of the simplest and highest-impact optimizations you can make for your site.

Additional Resources

Want to learn more about how PHP versions affect WordPress performance and security? Check out these resources:

That‘s all for now. If you have any other questions about updating PHP versions in WordPress, hit me up in the comments below!

Did you like this post?

Click on a star to rate it!

Average rating 0 / 5. Vote count: 0

No votes so far! Be the first to rate this post.