How To Upgrade WordPress to PHP Version 7

What version of PHP is your WordPress site running? Why does this matter and how do you find out? I’ll show you how to manually upgrade your PHP in this article.

WordPress Wapuus
WordPress mascot (Wapuu)

Running the latest version of PHP is said to make your site run 2-3x faster, but you should do some testing before upgrading. There could be compatibility issues with your theme or plugins.

What is PHP

PHP is a part of WordPress – it’s the code that helps it to run. Here’s a more technical description from WPBeginner.

PHP is a programming and scripting language to create dynamic interactive websites. WordPress is written using PHP as the scripting language. Just like WordPress, PHP is also an Open Source.

Why Do I Care What PHP Version I Run?

The typical WordPress user probably doesn’t know or care about PHP – they just want their sites to run and do what they’re supposed to. So it’s up to those of us who manage and care for WordPress sites to check on PHP versions and make sure sites are ready for the newer (or newest) version, which is PHP 7.

Your hosting site may or may not upgrade you – they may decide to run on a recent version that is stable with most plugins so as not to rock the boat with their customers.

PHP 7 was released the end of 2015, but as of August, 2016, only 2.2% of WordPress sites were running this version. This latest version is one they say will make your sites run 2-3 times faster than version 5.6 (what 97.8% of sites) are currently running. This article by Sarah Gooding of WP Tavern has the above stats.

php stats on wordpress usageGetting Ready to Upgrade to PHP 7

The best way to do an upgrade is to take your current site and put it on a staging or sandbox site for testing. I use BackupBuddy to backup my site and my client sites.

After the site is in my sandbox site (I use DesktopServer), I’m ready to log into my cpanel with my hosting company and do the upgrade. Before doing that, I decided to give WP Engine’s PHP Compatability Checker plugin a trial run to see what it said about my theme and plugins.

The plugin is free from the repository. After installation, go to ‘Tools’ and click on ‘PHP Compatability’.

PHP Compatability Plugin from WP EngineThen, you’ll be taken to a screen that lets you check which version you want to check your theme and plugins against – could be version 5 or 4. There are numerous warnings on this page about the plugin returning false positives and the running of the plugin could get hung up, it may not catch all incompatibilities and so on.

I clicked on Version 7 and then started the scan. Nothing happened for the first minute and I wondered if it was working, but then I saw the progress bar advancing. It analyzes each plugin in alphabetical order. If you have a lot of plugins, it’ll take quite a while.

When it was finished, the results popped in right away and I was able to scroll down and see them. I had 4 plugins out of my 29 that were ‘possibly’ not compatible. I could click the ‘view details’ and see what it said.

I decided I’d go ahead and change my version to PHP 7.

PHP compatability scan checkerA few notes on this free plugin from WP Engine. Before I install plugins, I always see how many downloads there have been and then I glance at the ratings. Then I actually will delve into some of the comments if it’s a plugin I’ve not heard of before.

There were a lot of 5-star ratings, but there were also quite a few comments from developers who didn’t think the plugin was all the effective or helpful. It may not be to a developer, but it may be to those of us ‘normal’ users.

How to Upgrade WordPress to PHP 7.0

I wanted to put PHP 7 on my site and here’s how I did it.

I logged into my hosting account at A2 Hosting, went to cpanel and looked for the PHP Version selector.

php selector in cpanelWhen I clicked on the ‘Select PHP Version’, I saw a screen where I chose version 7.0 and clicked to save it.

selector for php 7.0 in wordpressTesting

PHP 7.0 is applied immediately and I could test my pages and plugins to see if things worked and so far, everything is.

If you want to get really analytical, do a speed test (I like, both before and after you apply the upgraded PHP version and see if your site runs any faster. My site loaded in 2.5 seconds, which is pretty good. But I forgot to run the test before I switched!

Are you going to first test and then upgrade your site to PHP 7? I’ve not decided on all my client sites yet. As more time goes by, more and more plugins and themes will be updated to alleviate issues.


Scroll to Top