Hiding WordPress’s ‘PHP Update Required’ Dashboard Warning

Published by John on August 27, 2019 Under PHP

wordpres_php_update_required

Recently, when logging into wordpress, I saw a warning that said:

PHP Update Required

WordPress has detected that your site is running on an insecure version of PHP.

This particular server was running PHP Version 5.6, which has reached it’s end of life, although it is still getting security updates, the best way to hide/remove this warning is to upgrade php to PHP 7. PHP 7 is significantly faster and generally, at least for wordpress sites, updating to PHP 7 doesn’t break anything.

If for some reason you do want to hide this warning though, you can do so by removing the dashboard_php_nag meta box. Add the following to your functions.php file:


function kcr_remove_dashboard_widgets(){
    remove_meta_box('dashboard_php_nag', 'dashboard', 'normal');
}

add_action("wp_dashboard_setup", "kcr_remove_dashboard_widgets");

Again, upgrading PHP is the better solution, but since that isn’t always possible, the above can at least remove the warning. It also isn’t clear if the tool that they use to check php version is broken or if they have officially dropped support for PHP 5.6.

They have a URL here, which is used to check the version of PHP: https://api.wordpress.org/core/serve-happy/1.0/?php_version=5.6.80

At the time of this article, even though it appears that the minimum version is PHP 5.6.20, but I’ve only been able to get it to show as ‘is_supported’ when changing the version to 7.

wordpress_supported_php_version


No Comments |

Add a Comment