How to hide "PHP Update Required" widget on WordPress Dashboard


When you login to your WordPress dashboard, you land on a page with different boxes ( widgets ) like "At a Glance", "Activity", "Quick Draft", "WordPress Events and News" or "Welcome".

You can have other widgets, depending on your installed plugins or even server configuration.

"PHP Update Required" message box

Some of these messages can be annoying.

Like for example the "PHP Update Required" message which can be seen these days in WP.

Don't get me wrong. If you see such a "PHP Update Required" warning message then go ahead and upgrade PHP!

But if the message appears even after you upgraded, then this becomes annoying.

The warning appears because you host does not allow you to upgrade to PHP 7.3 (recommended PHP version by WP), but only to PHP 5.6. I have seen this recently in a GoDaddy account.

The good this is that you can hide his warning as well as others. And that is pretty easy to do.

Just click on top right "Screen Options" and uncheck the ones which you want to hide:

wp dashboard widgets

But... wait! This setting which you just applied will be only for you! It means that other users will be able to see it. If you have a multi-user website and do not want the other users to see that message then you need a different solution.

How to hide "PHP Update Required" warning for all WP users

If you want to hide that message all you have to do is:

a. Create a CSS file, name it hide-php-update-message.css and add the below CSS code to it:

#dashboard_php_nag {display:none;}

The above code hides the <div> which has dashboard_php_nag ID.

php warning css id

b. Upload the CSS file to your WP theme folder ( wp-content/themes/your-theme-folder ) via FTP ( or SFTP or whatever method you use ).

c. Download your functions.php file to your computer. You need to connect via FTP to do this. This file it is found in your theme folder. Open your functions.php file. Add the below code at the end of the file:

// Update CSS within admin area
function zi_admin_styles() {
  wp_enqueue_style('admin-styles', get_template_directory_uri().'/hide-php-update-message.css');
add_action('admin_enqueue_scripts', 'zi_admin_styles');

d. Upload functions.php file to your theme folder via FTP

e. That is all! The warning message is not visible anymore, for all users.

How can you hide other WordPress Dashboard boxes?

You can hide other sections, not only the PHP Upgrade Warning. All you have to do is to edit the CSS file which we have added above. You need to add the specific ID tag or class for the section you want to hide.

How can you know what is the ID of a section?

That is easy. In your browser, just use the Code Inspector and check what is the code for a specific section. There you will see what is the ID or Class for the specific section, like you have seen in the previous image.

How to hide WordPress Welcome box/panel?

Just to be sure that you got this, let's try to hide the big "Welcome" box which you can see on WordPress dashboard page. All you have to do is to add the below code to your css file from above, just below the first line:

#welcome-panel {display:none;}

You can see the <div> ID for the "Welcome" widget in the below image:

wp hide welcome panel

I hope you will find this useful and I would like to hear if you have any questions or suggestions.

Comments closed

Please contact me, if you have any questions or suggestions.