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 );
Default image
Austin
๐Ÿ’๐Ÿฝโ€โ™‚๏ธ Husband to Jeana. โšพ๏ธ Dodgers obsessed. ๐Ÿ† World Series Champs. ๐Ÿ’ป Lead Software Engineer @ Beachbody. ๐ŸŒ๐Ÿผโ€โ™‚๏ธScratch golfer. ๐ŸŒฑ Hydroponic Gardner. ๐Ÿฟ Plex nerd. ๐Ÿš™ '15 WRX & '66 Corvette C2. ๐Ÿถ Missing my love Keiki; RIP ๐Ÿ˜ข. Follow me on Twitter @TheFrosty & Instagram @TheFrosty.
Articles: 285

6 Comments

  1. 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.

  2. 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.

  3. “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 ?

  4. 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.

Leave a Reply

%d bloggers like this: