How to hide the WordPress update message in a git production enviroment

Since I use git on a lot of my projects, I don’t want to update WordPress in the production environment. So I wrote a few lines of code, that hides the update message. Add it to functions.php if you want to use it.

// Hide update nag on the production server
$production = 'http://PRODUCTIONURL.com';
$check_url = home_url();
function hideUpdateNag() {
remove_action( 'admin_notices', 'update_nag', 3 );
}
if ( $production == $check_url ) {
add_action('admin_menu','hideUpdateNag');
}

If you find some issues, or have some great ideas on how to improve it, just fork the gist.

You may also enjoy…