Remove Jetpack menu page

Remove the Jetpack menu page for users who can't "manage_options" or any WordPress role you would like to set.

I recently moved my WordPress plugin marketplace to a new domain; Extendd.com. I’m in the process of cleaning up client/users dashboards in the admin area, and had to remove a few menu items that we’re not necessary for the subscriber role.

Since subscribers can’t do anything on the Jetpack page, why should it be there? Here is the snippet I put in my core plugin file to remove Jetpack menu page.

if ( class_exists( 'Jetpack' ) && !current_user_can( 'manage_options' ) ) {
	remove_menu_page( 'jetpack' );
}

Just add that into a function that gets called on admin_menu really late like so:

function ap_remove_jetpack_page( ) {
	if ( class_exists( 'Jetpack' ) && !current_user_can( 'manage_options' ) ) {
		remove_menu_page( 'jetpack' );
	}
}
add_action( 'admin_menu', 'ap_remove_jetpack_page', 999 );
Austin
Austin

πŸ’πŸ½β€β™‚οΈ Husband to Jeana.
⚾️ Dodgers & Brewers.
πŸ’» PHP Engineer.
πŸŒπŸΌβ€β™‚οΈGolfer; ~14 HDC.
🌱 Hydroponic Gardner.
🍿 Plex nerd.
πŸš™ '15 WRX, '22 Model 3 LR, & '66 Corvette C2.

Follow me on Twitter @TheFrosty & Instagram @TheFrosty.

Articles: 292

6 Comments

  1. Thanks for this. I was surprised when i saw subscribers were able to unlink jetpack on my site. This at least hides the menu

  2. Nice little plugin!

    To answer your question (and zeaks’), the Jetpack menu is there so that each registered user can connect to their WordPress.com account and enable notifications.

    This way, if they also have a WordPress.com site, or if they are members of multiple Jetpack sites, they can receive notifications and reply to comments from any site.

    No worries though, they won’t be able to changes your Jetpack settings, or disable any module.

  3. Any idea WHY the priority must be set so high? I had it set to 100, then 500 and finally 999 before it would work for jetpack. I got it to work with other menus at a much lower priority. It wasn’t until I found your post that I thought to set it to 999. Not sure the logic behind this and wonder if you have any idea.

  4. “No worries though, they wonÒ€ℒt be able to changes your Jetpack settings, or disable any module.”

    Then why don’t they show only what they need to see ?

  5. Un-freakin-believable. Why Jetpack would make it available to subscribers? This confuses subscribers, who don’t know what WordPress is, let alone Jetpack. Jetpack creators, get out of your little bubble. If it weren’t for your stats feature, I would gotten rid of your plugin a while back.

Comments are closed.