How to remove the Jetpack admin menu from subscribers

- by

JetPackThe Jetpack admin menu is visible to everybody, including subscribers. This may not be what you want. You may even want to hide it from other admins, perhaps once you’ve given a site over o a client and you don’t want him to switch off vital functionality by accident.

Here’s how you can hide the Jetpack admin menu in your WordPress back end.

Hide Jetpack from Non-Admins (including Subscribers)

If you would like your admin users to see Jetpack and hide it from everyone else, add this to your theme’s function.php file:

function pinkstone_remove_jetpack() {
	if( class_exists( 'Jetpack' ) && !current_user_can( 'manage_options' ) ) {
		remove_menu_page( 'jetpack' );
	}
}
add_action( 'admin_init', 'pinkstone_remove_jetpack' );

Here we test “is Jetpack actually running”, and if it is, “is this user an administrator”. If all signs point to yes then we’ll remove the menu page. You can replace “pinkstone” with another prefix of course.

Feel free to change the user capabilities to something else if you’d like to make Jetpack visible to authors or editors. You can read more about those options here:
https://codex.wordpress.org/Roles_and_Capabilities

You can also achieve this functionality by installing a super small plugin courtesy of Jeremy Herve, lead author of Jetpack:
http://wordpress.org/support/topic/how-do-i-disable-jetpack-from-subscribers

Hide Jetpack from everybody

Here we remove the check for capabilities altogether, hiding Jetpack from all users:

function pinkstone_remove_jetpack() {
	if( class_exists( 'Jetpack' ) ) {
		remove_menu_page( 'jetpack' );
	}
}
add_action( 'admin_init', 'pinkstone_remove_jetpack' );

I have included this functionality in my Zen Dash plugin with the latest version 1.4, where you can now hide Jetpack from admins and other users at the flick of a switch (and bring it back just as easily):

Have fun, and happy hacking 😉



If you enjoy my content, please consider supporting me on Ko-fi. In return you can browse this whole site without any pesky ads! More details here.

6 thoughts on “How to remove the Jetpack admin menu from subscribers”

  1. Any idea how to just remove the ‘link to wordpress.com’ section from a users profile page if they’re not an admin?

  2. Hi Robert, I don’t see that option with the JetPack menu. Are you sure it’s a self-hosted site? If it’s a WordPress.com site, the above fix won’t work (because we can’t patch a functions.php file).

  3. Yeah, it’s self hosted.

    I hid it with CSS in the end.

    Jetpack adds a link in the user edit screen to link your account to a wordpress account. I think it’s probably just for users with permission to create posts.
    We’re using theme my login to add frontend login and profile pages and I couldn’t find any way to get rid of the jetpack parts.

Leave a Comment!

This site uses Akismet to reduce spam. Learn how your comment data is processed.