# Hide Jetpack for Contributor [closed]

I installed jetpack to my wordpress blog site. How can I hide jetpack to contributors, and show it only to administrators?

Thanks

## closed as off-topic by Mark Kaplun, birgire, Pieter Goosen, gmazzap♦, Johannes PilleSep 28 '14 at 12:34

This question appears to be off-topic. The users who voted to close gave this specific reason:

• "Your question should be specific to WordPress. Generic PHP/JS/HTML/CSS questions might be better asked at Stack Overflow or another appropriate site of the Stack Exchange network. Third party plugins and themes are off topic." – Mark Kaplun, birgire, Pieter Goosen, gmazzap, Johannes Pille
If this question can be reworded to fit the rules in the help center, please edit the question.

This code will do the trick. Create a file, jetpack-hide.php (or another name of your choosing) and upload it to wp-content/mu-plugins (create that directory if it doesn't exist).

add_action( 'jetpack_admin_menu', 'hide_jetpack_from_others' );
function hide_jetpack_from_others() {
if ( ! current_user_can( 'administrator' ) ) {
}
}


To re-enable JetPack for all users, simply delete that file, or rename it. I usually append .OFF to a mu-plugin that I want to disable, e.g., jetpack-hide.php.OFF.

• +1 for the Jetpack specific hook. Using current_user_can with a role is a bit controversial... better use a capability. Redirecting URL access attempts is a nice touch too ;) – brasofilo Jan 25 '13 at 16:19
• Thanks, @brasofilo. Wish I could take credit, it was adapted from this thread. – akTed Jan 25 '13 at 18:10

You can use a custom plugin, that hide this item in the menu, if the current user have the role "contributor".

The jetpack plugin allow the menu item for all roles, there have the capability read, on a default install have this all roles. add_menu_page( 'Jetpack', $title, 'read', 'jetpack', array($this, 'admin_page' ), 'div' )

A example for a custom plugin, there remove this menu item, if the user have not the role administrator.

/**
*/