☀️

What is the Best Version of PHP for WordPress?


The version of PHP you use has a major impact on the performance of your WordPress website. Especially if you’re currently on PHP 5.x — version 7.x is a significant leap in performance.

The best PHP version to use with WordPress is PHP 7.4.6. It is the latest version of PHP and has the best performance until version 8.0 is released later this year.

WordPress is over 300% faster with PHP 7.4

The minimum version WordPress supports is PHP 5.6.20 at the time of this writing — but you should avoid it. PHP 7.4 is over 300% faster. Meaning, if you’re still on PHP 5.x and your web server host offers 7.x, you can expect a huge performance improvement just by making this one simple switch.

And that kind of performance improvement will be a big user experience improvement your reader’s will thank you for.

The minimum version WordPress supports is PHP 5.6.20 at the time of this writing but you should avoid it. 

According to PHPBenchmarks, PHP 5.6 is at least 47% slower than PHP 7.3 Such a vast difference in performance is incredible. (wpastra.com)

According to the official WordPress Stats page, as of writing this, over 35% of WordPress users are still on PHP 5.6 or lower. (kinsta.com)

Kinsta also has a fantastic graph showing the difference in performance.

PHP 7.4~315 reqs/sec
PHP 7.3~305 reqs/sec
PHP 7.2~280 reqs/sec
PHP 7.1~270 reqs/sec
PHP 7.0~270 reqs/sec
PHP 5.6~95 reqs/sec

Really you should always be using the latest version, but there is something to be careful of: compatibility.

Beware of Plugin/Theme PHP 7.x Compatibility Issues

Now, I don’t want to scare you. Chances are you will have no issues at all. But there is a chance so I want you to be aware just in case.

WordPress core is compatible with PHP version 7.4 and above. At the time of this writing, the most recent PHP release is 7.4.6 — and WordPress itself will work fine with this version.

The issue you might run into is when PHP code has been deprecated and plug-in developers haven’t updated their code yet.

You could end up with plug-ins that don’t support the latest version of PHP. And this could lead to loading errors and other problems on your site.

Always Test Changes

In most web server hosting control panels it’s relatively easy to change the version of PHP. So what you do is change to the latest version of PHP that your host will allow, then go back to your site and thoroughly check for any issues that might have appeared.

If you find nothing then congratulations your website is compatible with the latest version of PHP and you can enjoy the performance benefits.

If you find errors then go back to your control panel and lower the PHP version by one. Then check your site again. Do this until you find no errors.

Repeat testing on new versions

Version 8.0 of PHP is expected to be released in November of this year (2020). As you can tell by the version number, this is a major release. Major releases generally contain breaking changes and will need more testing.

But version 8.0 is expected to be even faster than version 7.4 — so you will want to move to it as soon as your website becomes compatible.

Be ready.

Take care,

🐹, ✌️+❤️