X

Disable the help menu for admin only

Adding this snippet to the functions.php of your wordpress theme will display the help menu for the admin only.



Code Snippet:


function hide_help() {
if(is_admin()){
echo '<style type="text/css">
#contextual-help-link-wrap { display: none !important; }
</style>';
}
}
add_action('admin_head', 'hide_help');

Comments  Leave a Reply

  1. Doesn´t work in 4.2.2

    1. fixed the issue should have no problem now.

      1. Thanks. It works fine now

  2. Andrea Ballerino April 26, 2012 at 10:28 am

    It work well! Thank you.

  3. delete the ! before is_admin 😉

  4. wp3.3.1 dont working!

  5. Not workind

    1. Hi fg, are you sure you added this to the functions.php correctly as it only adds some CSS to the header of the admin section for non admins to hide the menu.

    2.  is_admin() is a check for whether the current page is an admin page, not what permissions a user has. Instead, try using the current_user_can() function, such as current_user_can(‘administrator’). (documentation at http://codex.wordpress.org/Function_Reference/current_user_can)

Add a Comment

We're glad you have chosen to leave a comment. Please keep in mind that all comments are moderated according to our privacy policy, and all links are nofollow. Do NOT use keywords in the name field. Let's have a personal and meaningful conversation.

WordPress Launch Checklist

The Ultimate WordPress Launch Checklist

We've compiled all the essential checklist items for your next WordPress website launch into one handy ebook.
Yes, Send Me the Free eBook!