Quick answer: WordPress is written in PHP, so the PHP version on your server affects how fast your site runs and whether it still receives security fixes. WordPress itself will run on very old versions (the minimum is PHP 5.2.4), but WordPress.org recommends PHP 5.6 or newer, and PHP 5.4 and older no longer get any security updates. PHP 7.0, released in December 2015, is much faster again. Check your current version, test your theme and plugins on a staging copy, then ask your host to switch.
Most site owners never think about PHP. It sits underneath WordPress, the host set it up years ago, and the site works. The trouble is that many hosts leave sites on the version they started with, and that version may now be years past its support date. That is a security problem you cannot see from the dashboard, and it often means the site is slower than it needs to be.
What PHP is and why the version matters
PHP is the programming language WordPress, its themes and almost all of its plugins are written in. Every time someone loads a page that is not cached, the server runs PHP code to build it: reading from the database, running plugin code and producing the HTML.
Each new version of PHP brings three kinds of change:
- Security fixes. Problems found in the language are patched, but only in versions that are still supported.
- Performance. Newer versions usually run the same code faster and with less memory.
- Language changes. New features are added and old ones are removed, which is why upgrading needs testing.
The PHP support timeline
Each PHP release gets two years of active support, with bug and security fixes, followed by roughly one year of security fixes only. After that it is end of life. Here is where the versions most WordPress sites use stand at the moment:
- PHP 5.2 and 5.3: end of life for years. No fixes at all.
- PHP 5.4: end of life since September 2015.
- PHP 5.5: active support has ended; security fixes only, and those stop later this year.
- PHP 5.6: still actively supported, and the most widely available safe choice on shared hosting.
- PHP 7.0: released on 3 December 2015, the newest version, fully supported.
If your site is on PHP 5.4 or older, it is running on software that receives no security patches. That is the main reason to act.
Why PHP 7 is worth attention
PHP 7.0 is the biggest change to the language in over a decade. The core engine was reworked, and benchmarks published by the PHP team and by WordPress developers show WordPress running a great deal faster and using much less memory than on PHP 5.6. For a busy site, that can mean faster page loads for uncached visitors, quicker admin screens, and the ability to handle more traffic on the same server.
WordPress 4.4, the current release, works with PHP 7, and the core team tested it heavily before release. The questions are your theme and plugins. Some older code uses functions that PHP 7 removed, most commonly the original mysql_ database functions, and code using those will fail outright.
PHP 7 is still new, and not every host offers it yet. If yours does, it is worth testing. If not, PHP 5.6 is a perfectly sound choice for now, and much better than anything older.
How to check which PHP version you are running
There are several easy ways:
- Your hosting control panel. In cPanel, look for “Select PHP Version” or “PHP Configuration”. Other panels have similar options.
- A plugin. Small plugins such as Display PHP Version show the version in your dashboard. Remove them once you have checked.
- A phpinfo file. Create a file containing
<?php phpinfo();upload it, visit it in your browser, note the version at the top, then delete the file straight away. It reveals details about your server you do not want public. - Ask your host. Support teams can tell you in a minute, and whether newer versions are available on your plan.
How to upgrade safely
1. Take a full backup
Back up the files and the database, and make sure you know how to restore them. Most hosts offer this, and plugins such as UpdraftPlus or BackupBuddy can do it too.
2. Update WordPress, the theme and plugins
Newer versions of plugins are far more likely to support newer PHP. Update everything first, on a staging copy if you have one.
3. Check for compatibility problems
Compatibility checker plugins scan your theme and plugins for code that will not work on newer PHP versions. It is not perfect, and it can flag false alarms, but it gives you a list to work from. Also check each plugin’s page on WordPress.org: look at when it was last updated and read recent support threads for PHP errors.
4. Test on a staging site
Set up a copy of your site on the new PHP version. Many hosts let you set the PHP version per folder or per subdomain, which makes this easy. Then click through the important parts:
- The home page and main templates.
- Contact forms and any booking or payment forms.
- The shop, cart and checkout if you run WooCommerce.
- The admin area, including the editor, media library and plugin settings pages.
Turn on WP_DEBUG on the staging copy and look for warnings and errors in the log.
5. Switch the live site
When staging looks clean, switch the live site at a quiet time and check the same pages again. If something breaks, switching back is usually a one click change in the control panel.
6. Replace what does not work
If an abandoned plugin will not run on a supported PHP version, that is a sign to replace it. Code that has not been touched in years is a security risk in its own right.
Common problems after an upgrade
- A white screen. Usually a fatal error from a plugin or theme. Rename the plugin’s folder over FTP to switch it off, then find a replacement.
- Deprecated warnings on screen. These are notices that code uses old features. Turn off display of errors on the live site and pass the list to the developer.
- Old custom code. Bespoke themes built many years ago are the most likely to use removed functions. A developer can usually update them quickly.
- Missing extensions. Some plugins need PHP extensions such as GD or Imagick for images, or cURL for connecting to other services. Check they are enabled on the new version.
What if your host will not upgrade?
Some cheap or older hosting plans are stuck on outdated versions. If your host cannot offer at least PHP 5.6, it is a strong signal to move. Running an unsupported version of PHP undoes much of the good work of keeping WordPress itself up to date. Our WordPress security guide covers the other basics worth checking at the same time, and our guide to WordPress speed optimisation explains what else affects load times beyond PHP.
FAQ
Will upgrading PHP break my site?
It can if your theme or plugins use old code, which is why you test on a staging copy first. Most well maintained plugins work fine.
Does WordPress tell me if my PHP is too old?
Not at the moment. WordPress keeps running on old versions, so you need to check yourself.
Should I go straight to PHP 7?
If your host offers it and your staging tests pass, yes. If not, move to PHP 5.6 now and plan PHP 7 for later.
Will a faster PHP version help if I use caching?
Cached pages are served without running much PHP, but logged in users, the admin area, carts and checkouts all still depend on it.
Want someone to handle the upgrade?
We check compatibility, test on staging and switch versions without downtime, and we fix the old code that holds sites back. If your site has not been looked at for a while, see how our WordPress development work can help you turn visitors into customers on a faster, safer site.