How To Update PHP Version In WordPress? (Beginner’s Guide)
Are you looking to update the PHP version on your WordPress site but not sure how to go about it?
WordPress has made it easy for just about anyone to create a website without knowing how to code. Nonetheless, your WordPress site is built on coding languages like PHP.
You don’t need to know PHP to run the website but you do have to ensure that you are running an updated version. This is because hackers exploit outdated versions of PHP to hack into sites.
Next, they wreak havoc on your site by defacing your home page, displaying malicious ads, and redirecting visitors to harmful sites. If your WordPress site is hacked, Google will be quick to blacklist it and your web host will suspend your account.
Luckily, you can prevent all this from happening by updating your PHP version. In this guide, we’ll show you how to check which version your site is using and how to update it.
TL;DR – If your WordPress site is using an outdated PHP version, hackers are going to exploit it to hack into your website. You need to update your PHP version immediately. Install MalCare to scan your site to make sure it isn’t hacked already. It will also proactively block any hackers from attacking your site.
What Is PHP On A WordPress Site?
Every website is built on code. You never see it but it plays an important role in the appearance and functioning of a website. There are several different languages of code and WordPress uses a combination of four main languages:
- HTML and CSS are declarative languages that run in web browsers. They control the appearance of a website such as your website’s layout and images.
PHP is by far the most popular language for web development. The WordPress core, and most of the themes and plugins are primarily written in PHP. You can consider it as the engine of WordPress.
Why do you need to be concerned about the PHP on your website?
We mentioned that PHP runs on your web server. This means any problems with the site performance that stem from PHP must be fixed by you. If there are PHP-related issues on your server, your website will perform poorly even if your visitor is using the fastest wifi connection, an optimized browser, and the best computer in the world. None of it will make a difference.
If you are running on an outdated version of PHP, it’s likely to cause problems on your WordPress website.
Why Do You Need To Update Your PHP Version?
There are three main reasons why you need to keep your PHP version updated:
PHP is an open-source programming language. This means anyone can modify, improve, or contribute to the development of the language. The language is also extremely popular and is used by millions of developers around the world.
Both these factors make PHP an attractive target for hackers. If vulnerabilities appear in the language, developers fix it quickly and release a new version of the language. This version will have a security patch for the vulnerability. When you update the PHP version on your site, the vulnerability will be removed and your site will be secure.
This is not to say that prior versions lack security measures. It just isn’t secure enough to keep your site protected against a determined hacker.
2. Speed and Performance
Developers also constantly work hard to improve and enhance PHP. They release new versions with upgrades and new features. Once you update to the new version, your site will see a performance improvement in load speed and enhancement of the performance.
3. Search Engine Optimization
Statistics show that 40% of visitors will bounce from a website if it takes more than 3 seconds to load. Plus, Google has made load speed one of it’s ranking factors. You can check why your website is slow here.
Certain PHP updates will make your site load faster. This means your site will be able to retain visitors better. This will translate into a higher ranking on search results, improved user experience, and more conversions and sales.
WordPress keeps improving its core and releases updates on a regular basis. Plugins and themes also follow suit and ensure that their software is compatible with WordPress. The same principles apply to PHP as well. As the PHP language improves and is upgraded, WordPress along with plugins and themes also use the latest versions available.
If you don’t update your PHP, you’ll see plugins and themes becoming incompatible.
In such cases, with time, you won’t be able to update your plugins/themes or install new ones.
Now that you have a clear understanding of why updating PHP is so important to your site, we can proceed to check what version of PHP your site is running on.
How To Check PHP Version In WordPress?
Before you update to the latest PHP version available, it’s extremely important to check which version you’re currently using.
This is because updating PHP can sometimes cause incompatibility issues, especially if you haven’t updated it for a long time. It can sometimes cause plugins and themes to a malfunction or stop working on your site.
To check what version of PHP your WordPress site is using, we’ll show you two methods.
1. Using cPanel
Step 1: Access your web hosting account and go to cPanel.
Step 2: Here, you should find a section called Software. You’ll see ‘Select PHP Version’.
Step 3: Upon clicking that, you’ll be redirected to a new page where you can view what PHP version your WordPress site is running on.
In case this option is not available in your hosting account, we recommend installing a plugin.
2. Using a WordPress Plugin
Step 1: You can install a plugin called ‘Display PHP Version’. It is available in the WordPress repository.
Step 2: After you activate the plugin, visit your WordPress dashboard > Home > At a glance. Step 3: Here, you can see what version of PHP your website is using.
At the time of writing this article, the latest version of PHP available is 7.4. In the image above you can see that the PHP version is quite outdated. The site is running on version 5.6.
There have been 4 major versions since then that have been missed. (7.0, 7.1, 7.2 and 7.3 – Version 6 was abandoned)
Updating from 5.6 to 7.4 directly could cause your site to break or malfunction. But don’t worry, we’ll show you a safe way to update your WordPress site without facing any issues.
Steps To Take Before Updating Your PHP Version
We mentioned how updating the PHP version can cause your website to break or malfunction. To prevent this from happening, we strongly recommend taking these measures before updating your PHP version.
1. Take a backup of your WordPress site
Create a complete backup of your WordPress site before updating your PHP version. If anything goes wrong, you can simply restore your site back to normal.
You can get a backup of your entire site in under a few minutes by installing the BlogVault backup plugin. Simply add your website to the BlogVault dashboard and it will automatically take a backup of your site.
It also enables you to restore your site with a single click and is guaranteed to work.
2. Update WordPress
To ensure there are no issues whilel updating your PHP, always make sure your WordPress core installation is the latest. If you are running on an outdated version of WordPress and you update to the latest PHP version, it could cause incompatibility issues and render your site unusable.
Go to your WordPress dashboard. If a new version is available, it will prompt you like in the image above. Click on Update Now.
3. Check your plugins and themes
We recommend visiting your WordPress dashboard and checking the list of plugins and themes you have installed.
If there are any updates pending, we recommend updating them first. Again, this is because some plugins may become incompatible with the new version of PHP. We recommend first completing the PHP update, and then enabling your plugins one by one to ensure each one works fine.
However, if you see a warning that the new version is not compatible with your PHP version, you should definitely disable the plugin before updating PHP.
You can be sure it will cause trouble on your site. We recommend updating the plugin after you’ve updated PHP.
4. Check PHP compatibility
You can use a plugin called PHP compatibility Checker to check if updating your PHP can cause problems.
This isn’t a sure shot method of checking compatibility issues as sometimes the plugin misses items or throws up false positives. However, in most cases, it is helpful.
If you find compatibility issues, we recommend disabling those plugins or themes before updating them. You can contact the developers and ask them to investigate the issue. If they aren’t able to resolve the issue or don’t respond to you, you’ll need to find alternative options for these incompatible plugins and themes.
Now that you’ve taken these precautions and can be sure your site can handle the update, you can move on to safely updating the PHP version on your WordPress site.
How To Upgrade PHP Safely And Easily?
We mentioned earlier that some coding languages run in web browsers, while PHP runs on your web server.
Your web server is controlled and managed by your web host. Unless you have your own server, you will likely not have control over it.
Thus, you won’t find an option to update PHP on your WordPress dashboard. You have to use your web hosting account to do update PHP on your web server.
Each web hosting provider has a different method of updating PHP, however, they will be quite similar. We’ll show you how to update using cPanel with two hosting providers GoDaddy and NameCheap. If you are using any other host, you can find instructions on how to update PHP in these links.
- GoDaddy (Web & Classic Hosting)
- Inmotion Hosting
- WP Engine
How to Update PHP version Using NameCheap?
1. Login to your NameCheap web hosting account.
2. Go to cPanel > Software > ‘Select PHP Version’.
3. Under PHP version: you’ll see the text in blue with a dropdown menu. Select the version you want to update to and click on ‘set as current’.
Your PHP version is now updated.
Also Read: WordPress Site Not Loading? Here what to do
How to Update PHP version Using GoDaddy?
1. Log in to your GoDaddy hosting account.
2. Access My Products > Web Hosting > Manage.
3. Under Settings, switch to Server.
5. Click on the option ‘PHP version.’ A pop up will appear which allows you to Change PHP Version.
6. Select the version you want to update, type ‘update’ to confirm and save changes.
Your WordPress website is now running on the latest version of PHP. We strongly recommend visiting your site to ensure that the update ran smoothly and your website is functioning correctly. In case you run into any problems or are unable to update your PHP version, you need to contact your web hosting provider.
Using outdated software affects your site’s security and performance. Now that you’ve updated your PHP version, your site will be better and faster! It will also be more secure against hackers.
However, this is only one step in the right direction towards better WordPress security. We recommend that you always implement the following on your WordPress site:
- Use our security plugin MalCare to scan and monitor your site. Its robust firewall will block hackers from attacking your site.
- Take a backup of your WordPress site. In the event that something goes wrong with your site, you can use your backup copy to restore your site to normal.
- Harden your WordPress site to make it difficult for hackers to break in. You can refer to our detailed Guide on WordPress Hardening.
With that, your WordPress site now performs better and is completely secured.
Secure your site with our MalCare Security Plugin!
Melinda is a WordPress enthusiast, and enjoys sharing their experience with fellow enthusiasts. On the MalCare blog, Melinda distils the wisdom gained from building plugins to solve security issues that admins face.