If you are not running the most recent version of PHP, you are hurting the load speed of your WordPress website. Studies have shown that any website that takes more than 6 seconds to load will be abandoned by 53% of people that visit it. That’s huge! That’s why you need to learn how to update PHP in WordPress.
Updating the PHP version of your website is one sure way of improving site load speed. Even more, it lessens the chances of hackers gaining access to your website.
In this article, we’ll show you how to update PHP on WordPress to the latest version.
Content of this article is:
- WordPress and PHP
- The Benefits of updating to the Latest Version
- What to do Before Updating
- Methods for Updating
PHP and WordPress
Do WordPress sites use PHP? A lot of beginners ask this question. The answer is yes! WordPress was built on PHP, a server-side scripting language. WordPress has undergone several updates ever since the very first version – also has PHP.
What that means is that if you run the latest version of WordPress on an outdated PHP version, you are very likely to run into problems.
Update the PHP To The Latest Version – Benefits
1. Improved Security
PHP is an open source programing language. WordPress, as well, is open source. This makes them very popular – and also potential targets for hackers. To safeguard your website from hackers, upgrading to the latest version of PHP is a must. This is not to say that older versions -like PHP version 5 – completely lack security features, they aren’t secure enough to keep away a determined hacker.
2. Improved Load Speed
While there are many techniques you could use to improve the load speed of your website, updating to the latest PHP version is one sure method. The most current version of PHP is three (3) times faster than the older version.
3. Improved SEO
Load speed is one of Google’s ranking factor. A faster website means a higher ranking in search results, improved user experience, and more sales!
What to do Before Updating PHP
Here are a few things to do before updating PHP.
Backup Your Site
Before doing any update in WordPress, it’s always advised to create a backup. The same is applicable when updating the PHP version of your WordPress website.
Here are two major reasons why creating a backup before updating to the latest PHP is important.
- WordPress themes and plugins are also written in PHP. If any of the plugin or your theme is badly scripted, there will be compatibility issues once the update happens.
- Something might go wrong during the updating process. A typical example is the loss of internet connection. As minor as the issue looks, it could lead to a catastrophic outcome in some cases.
To prevent these possible problems from ruining your site, back up your website before making any updates. It’s easy!
Now that you’ve seen the benefits of updating to PHP’s latest version and have hopefully backed up your website, let’s show you how to update your PHP version.
Update plugins and themes
There are chances that your plugins and themes may not be compatible with the latest version of PHP.
To prevent this from happening, you should update your WordPress plugins and themes to the latest versions.
- Log in to your WordPress dashboard.
- Go to Dashboard >> Updates.
- Install all available updates
Check PHP Compatibility
Now that you have the latest version of plugins and themes, you test them using the PHP Compatibility Checker. To do this:
- Go to Plugins >> Add New and search for “PHP Compatibility Checker”.
- Install and activate a plugin.
- Next, go to Tools >> PHP Compatibility.
- Select the latest version of PHP.
You may choose to scan only active plugins/themes or scan everything.
Click “Scan site”.
The plugin takes it from here. It scans and identifies any compatibility issues between PHP and your plugins/themes.
If there is a problem, you may either let go of the plugin and search for an alternative one.
How to Update the PHP Version of your Website
There are two ways to go about this: through your control panel (cPanel in this example), and by contacting your host provider.
1. Update PHP version in Cpanel (or Any Other Control Panel)
Log into your control panel, locate the “Select PHP Version” tab.
Click it. On the next page, you will see your website’s PHP current version. Select the latest version from the drop-down menu.
Lastly, click “Set as Current”. You are all done!
2. Contact Your Host Provider
Not all control panels are the same. If you couldn’t find the option for updating PHP on your dashboard, contact your hosting company. They will either do it for you or provide instructions.
The tech world is continually changing. Every day, there is a new update for something.
WordPress and PHP, being too very popular website resources, get regular updates that would keep your site running at its best. Once you have changed the PHP version of your website, you can enjoy the higher speed, security, and other features that come with the newest version.
After updating your PHP, ensure you update WordPress to the most recent version as well. You also want to update your themes and plugins to prevent compatibility issues.
- Remove Query Strings from Static Resources – 2 Methods
- How to Move WordPress Site to New Domain
- Complete WordPress Multisite Network Guide