21
0
![]()
[postInfoBox subject="wordpress" difficulty="Wordpress Newbie" completiontime="3-5 Minuts"]
Upgrading your WordPress website is an important process and keeps your website safe from hacks and up to date with all the new features out there. Even so, many web managers or even while building a WordPress site need to hide the “please update” message (which you can see in the above image) so others won’t see it and try to click on it. Either way, a user that is not the admin cannot update WordPress since he lack capabilities but he still sees it and it to put it lightly un-professional.
Why Should I Hide wordpress Update Notification
- It doesn’t look professional
- No need for writers to see it
- It reveals your WordPress version
- Easy to change & you’ll still see it
Give Me An Example Where Its A Must!
A great example where hiding “please update” notification is crucial is any WordPress based article site or blog where you allow multiple writers to submit posts / articles.
We Also manage an article website called Publish Your Articles which allows registered writers to submit articles and currently have more than a 1000 writers which usually submit their articles directly in the admin of the website. Even though most data is already blocked I don’t think it’s suitable for them to see the update notice.
How Do I Hide the Update Notification?
First I want to emphasis we are not hiding the update notification completely but just setting it visible to admin level user only.
[warning]
Embedding the next code should be done by an experienced WordPress web manager which knows how to embed PHP code in WordPress Functions.php file & how to remove it should he encounter any error. We cannot take any responsibility for misuse of this code.
[/warning]
- What: A code that hides WordPress update notification
- Where:Inside our functions.php file
global $user_login;
get_currentuserinfo();
if (!current_user_can('update_plugins')) { // checks if current user is admin
add_action( 'init', create_function( '$a', "remove_action( 'init', 'wp_version_check' );" ), 2 );
add_filter( 'pre_option_update_core', create_function( '$a', "return null;" ) );
}
Explaining The Code
This part checks if current user can update plugins aka if he’s the admin.
global $user_login;
get_currentuserinfo();
if (!current_user_can('update_plugins')) { // checks if current user is admin
This action & filter removes the ‘notification update action’ and returns null instead.
add_action( 'init', create_function( '$a', "remove_action( 'init', 'wp_version_check' );" ), 2 ); add_filter( 'pre_option_update_core', create_function( '$a', "return null;" ) );
Installation of this code is easy. Just Copy & Paste it to your functions.php file, upload the updated functions.php file via an FTP software and you done. Good luck, Sagive SEO
Did you like the article? Share the love
Organic Seo campaigns in Israel & the world. Social Branding, Ad campaigns, Wordpress Web Design and more
Get News Update