Are you looking for ways to optimize your website? Do you want a faster, more secure and operational WordPress website? Today we will be discussing how to update PHP in WordPress to help you achieve these goals.
The key to running a successful online business is to make sure that you’re up to date with the current market trends. From managing your site’s user interface to making sure that you are running the latest software – this maintenance is not only helpful, but crucial in the long run.
Although we push ourselves to improve the content and user experience of our website, we often forget to update the basic software that is at the root of our business. Although WordPress is built on coding languages like PHP, you don’t need to learn these languages to successfully manage your website.
However, you do have to make sure that you’re running the latest version of code bases and plugins, as hackers often attack outdated versions of software.
Hackers can induce havoc on your website homepage, launch multiple spam pages, display malicious ads, and more. You can save yourself from this nightmare by making sure you’re running the most recent version of PHP. To help you with this, we’ve shared a detailed step-by-step process on how to update PHP in WordPress.
But first of all, let’s understand..
What is PHP on WordPress?
We all know that websites are built with code. What visitors typically interact with is the beautiful front-end; but at the back-end, some extensive scripts are running that help us achieve full functionality.
PHP is a dynamic programing language that runs on the server-side. It allows us to use and operate different functionalities on our websites such as navigation menus and buttons. PHP is by far one of the most important languages of Web development. Hence, a lot of WordPress plugins are also written in PHP.
Why do I need to update my PHP version?
We mentioned that PHP is a server-side programming language. This means that if any problem arises on your website, it stems from the PHP version at the backend. Here are the 5 main reasons why you need to update your PHP
1. Speed and Performance
The developers that are working on the backend are always trying to improve and enhance the website performance. For this, they call multiple functionalities from the PHP language to save user-side server load. By updating your PHP version, your site will see a performance improvement along with speed enhancement.
Just like WordPress, PHP is an open-source programming language. Meaning that anyone can download it, modify it, make some changes, and contribute to the development. This language is already very popular in the world and is an all-time favorite of many programmers.
Both these factors make PHP very attractive to hackers. If you’re running an outdated version of PHP, chances are you might be exposing a vulnerability. If in case any vulnerability appears, the developers fix it quickly and release a newer version with improved security measures. By making sure you’re running the most updated version you can save avoid countless potential issues.
3. Search Engine Optimization
This one is for all the webmasters out there. Studies show that if you’re running a website that has more than 3 seconds of load time, about 40% of the visitors will bounce back from your website. Google has also made the page loading speed very crucial for the website ranking process. How PHP address is that it makes the coding part a bit lighter with each update, so your website can run seamlessly.
WordPress and PHP go side by side. The developers of your theme, plugins, and other software keep on introducing new features that require the updating version of PHP. So, if you’re running an older version, you might get a message to update your software first to enjoy new features.
Mail Chimp, for example, is a popular email marketing platform. The developers of this platform always require you to run the latest version of WordPress and PHP.
5. New Features and Improvements
In general, updating your site to the newest PHP version ensures that you’re rocking the newest features introduced by the developers. One quick example of this is that PHP recently introduced a new feature called preloading in the 7.4 version.
Although WordPress themes sent prompt messages to developers to update their sites, many developers skipped these messages and ended up missing out on this feature.
It is in good practice to manually check for updates and read patch notes every so often.
Automatic Software Upgrades
Many hosting companies now offer automatic software upgrade features. This not only includes your core software like WordPress and PHP, but also your themes, plugins, and other installed software.
These hosting are smart enough to perform the upgrade when your website is mostly on idle mode. Chances are if you receive less traffic at night, your software will be upgraded during the nighttime.
Although this feature is great, sometimes it comes with consequences. For example, if the PHP version you just installed is unstable, your website is a sitting duck. To address this, hosting companies also offer free WordPress backup every day.
However, these features are limited per hosting accounts. So, if you’re running a cheap hosting package, you might not get these features. The only way you can upgrade your website is to run the manual operations.
Before you Upgrade
While it is unlikely that you will encounter some major issues, it is still better if you play it safe. Before you make any major changes to your website or perform a core update, it is always recommended to perform the following tasks.
- Make a Backup of your Website
- If you’re running a famous hosting provider like Bluehost or Namecheap, you will get a dedicated button of backup in your web hosting account. Otherwise, you can just go to your cPanel dashboard, look for the file WP-Content and download it. If you are running in Amazon EC2, check out this guide from AWS.
- Use Maintenance Mode
- Most of the time Maintenance mode is available through your active Theme. The only tricky part is to enable it from the settings. Some developers like to use under construction mode as well. If you can’t find it, then just install a Maintenance plugin from WordPress. It is important that you use this because PHP will take anywhere from 5-20 minutes to install on your Website.
- Check current PHP version
- Before you upgrade, you must check the current version of PHP. To do this, you have to log in to your cPanel account. Access your web hosting, navigate to the software tab, select ’PHP version’ and write down the version details on NotePad or TextEdit. In case the feature is not available in your cPanel account, then install the Display PHP Plugin.
- Update your Theme and Plugin
- This step is very important if you’re running third-party themes and plugins. After updating, there’s a chance that some functionalities of your website won’t work. To ensure maximum compatibility, update your website themes and plugins before the upgrade. For this, you can go to your Dashboard > Updates and install all the available updates.
How to Update PHP in WordPress
When it comes to updating PHP on your WordPress website, there are multiple ways to do this. Some are pretty advanced like using SSH Commands and some are pretty basic that can be done by anyone. Since we’re not a code ninja master, we’ll keep this simple.
By using your hosting service, you can easily upgrade the PHP version of your website. Now, every host is a little bit different when it comes to account management. But a quick google search associated with your hosting name can unveil quick answers.
We will provide the updated instruction for the 4 most common hosting providers; NameCheap, GoDaddy, HostGator, and BlueHost. If you’re using any other hosting, then follow the instructions in these links:
How to Update PHP in NameCheap
- Visit NameCheap and log in with your account
- Go to your cPanel and navigate to Software > Select PHP Version
- Here your Current PHP version is mentioned along with any update if you have any:
- Use the blue dropdown menu to select the updated number
- Click on the button ‘set as current’
- Your PHP version is now updated
Done! You have updated PHP in NameCheap!
How to Update PHP in BlueHost
- Login to your BlueHost cPanel Account
- Scroll down to the Programming Section and select ‘PHP config’
- Select the updated PHP version from the radio buttons
- After that, click on ‘Save Changes’
Done! You have updated PHP in BlueHost!
How to Update PHP in GoDaddy
- Login to your hosting account dashboard
- Go to My Products > Web Hosting > Manage
- Navigate to the Settings option and switch the tab to Servers
- From here, click on the option ‘PHP Version’
- A small pop up will appear, stating what current version you’re using
- Here, select the ‘Change PHP’ version and choose the preferred version
- Click on the ‘update’ button and select save changes
Done! You have updated PHP in GoDaddy!
How to Update PHP in HostGator
- Login to your cPanel hosting account
- Navigate to the software section and select MultiPHP
- Select the domain name you want to update
- Choose the preferred PHP version you want to install
- Click on Apply
Done! You have updated PHP in HostGator!
Self-check for testing your site after Update
Although rare, update issues can occur. Once you’ve updated your site, follow the instructions provided below for self-testing:
- Check your theme functionalities and ensure they are working as normal
- Randomly visit pages and posts to check if anything seems out-of-order
- Update your theme and plugins if available
- Download a newer version of your website backup
If any unusual circumstances occur, contact your hosting provider for a quick solution. You can also revert back to the previous PHP version, but contacting your hosting support first is always recommended.
Congratulations, you’ve successfully installed the latest version of PHP on your Website. Now go ahead and check the current version of the PHP. It will be surely be the version you just installed. Remove the under-maintenance mark from your website and enjoy the updated functionalities.
If you still have no luck updating your PHP version, then you should contact your hosting company. They will have the ability to update your web hosting software on your behalf.
Using outdated software not only negatively affects your website but also makes it prone to a larger amount of security threats. By updating your website to the newest PHP version, you will get the peace of mind that you’re as protected from hackers as you can be.
However, this is only one step to secure your website. You should always follow extra precautionary measures, just to be on the safe side.
- Update your WordPress, theme, and plugins
- Make sure you’re using a good hosting provider
- Enable security features from your hosting settings
- Use a reliable SSL certificate
- Monitor your website on the Firewall to check possible attacks
- Take a backup of your site, in case, things go south
- Use a strong password for your website
With these steps in mind, your WordPress website will perform better and be more secure overall.
Frequently Asked Questions
How can I prepare my website before the update?
You can prepare your website by updating the themes and plugins. Using a maintenance mode on the front end and download the latest backup file.
Does updating PHP break my site?
There’s very little chance that your website might break after an upgrade. But that’s nothing to stress about as you can easily roll back to the previous version. Plus, you can use the backup files as well.
What is the best version of PHP for WordPress?
The best version of PHP for WordPress is always the latest one. It comes with new security, better features, and tons of improvements. Use the latest version of PHP to improve your website speed and load time.