Upgrading your WordPress site to the latest PHP version


PHP is the programming language that powers your WordPress site. DreamHost highly recommends using the latest version of PHP on your WordPress site to ensure optimal performance and security. Additional benefits of staying up-to-date include:

  • Access to new features
  • Improved error handling
  • Enhanced database support
  • Compatibility with the latest WordPress versions, themes, and plugins.

PHP 8 improvements

PHP 8 offers several improvements over earlier versions, and upgrading is a quick and easy way to get more performance out of your WordPress site. You can read more about these improvements at the following link:

Please note that not all third-party themes and plugins have been updated to be compatible with PHP 8. If your site relies on a specific plugin or theme, make sure you verify that it is PHP 8 compatible before upgrading. You can confirm by checking the official theme or plugin page.

How do I know if I need to upgrade?

It's important to consider the following factors when determining if your WordPress site requires a PHP version update:

  • View the official theme and plugin page as well as support forums to check which versions of PHP they are compatible with.
  • Continually check your website's error logs, the WordPress Debug log, PHP error log, and general warnings, as these could indicate the need for a PHP update.

Also, make sure to regularly check the official WordPress.org website and community forums for any announcements or guidelines related to PHP versions, as they may provide valuable insights on when to update.

Which version should I upgrade to?

DreamHost recommends at least PHP 8.2 since PHP 8.1 has already been deprecated by php.net, and support for it will end soon.

Keep in mind that the latest version is the one that will be supported the longest and has the most current updates to improve performance. If you encounter an issue with the latest version, you can try the next most recent version without much difference in performance or support.

FastCGI and CGI

Each PHP version offers two options:

  • FastCGI
  • CGI

Typically, you should choose FastCGI as this offers faster performance for most sites. If your site's PHP version is currently set to CGI, you may have at one point encountered performance issues with FastCGI which prompted the change to CGI. You are welcome to try either one to compare performance.

Preparing your WordPress site for a PHP upgrade

Before proceeding, ensure that your live site is completely up to date. If a staging website is already in use, ensure that you have published any changes you wish to keep first before working on the staging site.

Please note that while following this checklist can help minimize issues, it is important to be aware that due to the vast number of themes, plugins, and customizations available in WordPress, there is always a slight chance of encountering errors or issues during the PHP upgrade process. In such cases, you can attempt to downgrade to the previous PHP version.

These steps are not mandatory, but they are highly recommended for maintaining the security and smooth functioning of your site:

  1. Check for any pending updates in your WordPress Admin dashboard and apply them.
  2. Identify and review older themes or plugins that haven't been updated by the developer in over a year. Consider finding suitable alternatives or contacting the developer for updates.
  3. Verify if you have any paid themes or plugins with expired licensing for updates. Renew the licenses or explore alternative options.
  4. If you have customizations written in PHP, it is recommended to have a developer review them for compatibility with the new PHP version.

Testing the upgrade using a staging site

A safe way to test the new PHP version is to create a staging website. This staging site will become a duplicate of your existing live website, allowing you to run tests to see how it reacts to the new PHP version.

If nothing unusual happens, you can upgrade your live website. View the following article for information on how to create a staging website:

Upgrading PHP on a WordPress site

The following article explains how to change the PHP version of your site in the panel:

If your WordPress site is running on DreamPress, view the following article instead:

See also

Did this article answer your questions?

Article last updated PST.

Still not finding what you're looking for?