Remove WordPress Version Number and WordPress Update Notice

, ,

Sometimes, as a developer, it may be beneficial to hide the WordPress version number and or hide the WordPress update notice from backend users. Particularly if you are aware that performing the update will cause issues with your presently installed theme.

Nothing beats getting it fixed immediately, but sometimes that just isn’t feasible. We still recommend that any security releases be implemented immediately and if you must, take the site down for maintenance. That is, until the theme compatibility issues have been resolved and the security updates implemented.

 

The following code snippets may be inserted into your child theme’s functions.php file to implement the stated outcome.

Hide WordPress Version

HIDE WORDPRESS VERSION

/*
** Remove WordPress Version #
*/
remove_action( 'wp_head', 'wp_generator' ); //removes WordPress version for frontend
//removes WordPress version from footer
if ( !is_admin() )
{
//hide WordPress version # in footer
add_action( 'admin_menu', 'hide_wpversion' );
function hide_wpversion()
{
remove_filter( 'update_footer', 'core_update_footer' );
}
}

 

Hide WordPress Update Notice

HIDE WORDPRESS UPDATE NOTICE

/*
** Remove WordPress Update Notice
*/
//removes WordPress version from footer and wp update notifications for non-admins
if ( !is_admin() )
{
//disable WordPress update notice
add_action( 'admin_head', 'hide_wpupdate_notice', 1 );
function hide_wpupdate_notice()
{
remove_action( 'admin_notices', 'update_nag', 3 );
}
}

 

Hide Both WordPress Version and WordPress Update Notice

HIDE WORDPRESS VERSION AND UPDATE NOTICE

/*
** Remove WordPress Version # and Update Notice
*/
remove_action( 'wp_head', 'wp_generator' ); //removes WordPress version for frontend
//removes WordPress version from footer and WordPress update notifications for non-admins
if ( !is_admin() )
{
//hide WordPress version # in footer
add_action( 'admin_menu', 'hide_wpversion' );
function hide_wpversion()
{
remove_filter( 'update_footer', 'core_update_footer' );
}
//disable WordPress update notice
add_action( 'admin_head', 'hide_wpupdate_notice', 1 );
function hide_wpupdate_notice()
{
remove_action( 'admin_notices', 'update_nag', 3 );
}
}

 

Conclusion

I welcome your thoughts, questions or suggestions on my article on how to remove the WordPress Version Number and WordPress Update Notice for backend users.

You may support my work by sending me a tip using your Brave browser or by sending me a one time donation using your credit card.

Let me know if you found any errors within my article or if I may further assist you by answering any additional questions you may have.

 

Editors Note:

  • Added notice to insert the code into the functions.php file within your child theme

 

2 replies
  1. Pete
    Pete says:

    Perhaps a dumb question. But your article on removing wordpress version number and update notice, as great as it is, I’m clueless where to place the file, whether it’s a copy and paste into an existing file, or what to call it. Any help is greatly appreciated. Kind regards, Pete.

    • Manny Rodrigues
      Manny Rodrigues says:

      Happy to help Pete. You would want to insert that code into your child theme’s “functions.php” file provided you are using one. If not, it is advisable to be using a child theme. Thank you for reaching out to me Pete. I will update the article as soon as I can with this information to help others.

Comments are closed.