Using WordPress websites with the latest PHP version is crucial for speed and performance. But you may find that your hosting company uses an older, less secure version. We’ve got you covered if you’re looking to update but have no idea where to start.
This “How to update PHP in WordPress” article will take you through all the required steps. We’ll provide step-by-step instructions and some valuable tips before and after the update.
- Reasons to Upgrade PHP
- How to Check Your Website’s PHP Version
- To-Do List Before the Update
- Update PHP in WordPress
- To-Do List After PHP Update
- Emergency Steps if PHP Update Breaks a Website
- How to Update PHP in WordPress – Resolved
Reasons to Upgrade PHP
Before we dive into the procedure, let’s discuss the importance of updating the PHP version of your website.
PHP developers update every version, so it uses resources more efficiently and has new functions and features. So, with every new update, your website is faster. The optimized performance keeps your visitors entertained and boosts your search engine rankings.
PHP is a very popular language that, nonetheless, often receives cyberattacks. They have vulnerability patches that can be exposed by hackers. But along with other defensive measures, new PHP versions are released to counter those attacks.
Websites that run on older PHP versions don’t have access to those fixes. As a result, they are more prone to viruses, malware, and other hacking attacks.
Note: Updating the PHP version alone won’t be enough to prevent intruders from targeting your website. You should consider other security measures to boost your website’s security.
All the best components of a WordPress website (themes, plugins, etc.) use the latest PHP version. If you don’t update your website regularly, compatibility issues can emerge between important files on your website.
Now that you’re aware of the importance of keeping your PHP version up to date on your website, let’s move to the more practical side.
How to Check Your Website’s PHP Version
Before you update your website, check which PHP version you’re using. To start, log in to your WordPress website as an admin and follow the steps below:
- Navigate to “Tools” then “Site Health.”
- Go to the “Info” tab.
- Scroll to the “Server” section containing data about your server.
- Check the information next to “PHP version.”
To-Do List Before the Update
Overall, switching to a newer PHP version shouldn’t be an issue. However, there are no guarantees. Once you’ve identified that your website runs on an older PHP version, don’t proceed to the update just yet.
It could just so happen that the plugins and themes won’t work. Although this is highly unlikely, you should still take steps of precaution:
- Create a backup of your site.
- Update your themes and plugins from the WordPress Dashboard.
- Check for PHP compatibility by installing a PHP Compatibility Checker plugin.
- Fix the PHP compatibility issues, if any.
After you run these steps, you’ll be ready for the PHP update.
Update PHP in WordPress
You can update the PHP version of your website manually, regardless of the hosting company. However, since the PHP version is configurated at the server level provided by the hosting provider, the update process requires you to interact with the host’s settings.
Different web hosting providers have different steps to complete the update process. Here’s an overview of how to update PHP in WordPress for some of the largest hosting providers.
If your company isn’t on the list, send them an email asking for instructions on updating your website’s PHP version to the latest.
- Log into your hosting account on Bluehost.
- From the “Account” dashboard, navigate to the “Advanced” tab on the left-hand sidebar.
- Press the “MultiPHP Manager” icon.
- Pick the PHP version you want to install and select the website.
- Hit “Apply” to save changes.
- Log into your account dashboard on Siteground.
- Go to the “Websites” tab and hit “Site Tools” next to the website name.
- Navigate to “DEVS >> PHP Manager” in the right-hand column.
- Hit the “Edit” icon and change the PHP version by number.
- A new popup will appear. Under “Set PHP Version,” choose “Change PHP version manually,” and under “Select PHP Version,” pick the latest version available.
- Hit “Confirm” to save changes.
- Log into your HostGator account and navigate to the “Hosting” section.
- Go to the cPanel link showing under the hosting account.
- A new cPanel dashboard will open where you can change the hosting account settings.
- Scroll to the “Software” section and select the “Multi PHP Manager” icon.
- Enter the domain name and pick the PHP version you want.
- Press “Apply” to save changes.
Even though WP Engine automatically upgrades the PHP version for the user, you can still perform a manual update or downgrade.
- Log into the WP Engine dashboard.
- Press the PHP version of the website next to your site name.
- A new popup will appear. Select whether you want to upgrade or downgrade your website’s PHP version.
- Press “Change PHP Version” to save changes.
Change PHP for Other Hosting Environments
Note that most hosting providers serving WordPress have a similar dashboard. If your hosting provider isn’t on the list, chances are you’ll find the “MultiPHP Manager” icon in your cPanel dashboard.
Once you locate this icon, you can follow the steps above, including selecting the PHP version you want or entering the number of the version manually.
If you can’t find the MultiPHP Manager or the settings look complicated to you, contact your hosting provider so they can update your website to the latest PHP version.
To-Do List After PHP Update
Now that you’ve safely updated the PHP version of your website, it’s time to check that everything works fine.
First, give your host up to an hour to fully update the PHP. After that, check all your website pages and test every plugin. Should any plugin encounter an issue, you can revert your website’s PHP to the previous version in your cPanel.
Here’s an additional step-by-step overview of what you should do after the update to keep your website in top-notch shape:
- Navigate to your website and look for any noticeable issues.
- Log in to the Admin area of your WordPress site.
- Make sure your WordPress is updated to the latest version. The same goes for themes and plugins.
- Create a backup of your website before and after updating any elements.
Emergency Steps if PHP Update Breaks a Website
Although this is highly unlikely, you should be prepared for some emergency steps if the PHP update breaks the site.
The first thing you want to do is check whether a plugin or theme is behind the error. The best way to analyze everything is to deactivate all active plugins and change to the default theme.
Contact your hosting provider for support if this easy fix doesn’t solve the problem.
How to Update PHP in WordPress – Resolved
Running a website means you have hundreds of things to think about. Updating your PHP version is one of them. Luckily, the procedure for updating PHP is pretty simple, and you can do it even if you aren’t a professional web developer. Remember to take all the necessary steps before and after the upgrade so nothing gets damaged on your website, and you’ll be good to go.
Hopefully, you now have all the answers to “How to update PHP in WordPress.” If you encounter problems at any stage, you can always search Google for easy fixes or contact your hosting provider or a web developer for assistance.