How to hide menu items from wordpress admin for your clients

Just use the Adminimize plugin!

If you don’t wanna, here are some functions

function remove_menus(){

   if (!current_user_can('administrator')) {

      remove_menu_page( 'index.php' );
      remove_menu_page( 'upload.php' );
      remove_menu_page( 'vc-welcome' );
      remove_menu_page( 'tools.php' );

      remove_menu_page( 'edit.php?post_type=vacancy' );
      remove_menu_page( 'edit.php?post_type=branch' );
      remove_menu_page( 'edit.php?post_type=person' );
      remove_menu_page( 'edit.php?post_type=page' );
      remove_menu_page( 'peak6-general-settings' );

   }

}
add_action( 'admin_menu', 'remove_menus', 20 );

add_action( 'admin_bar_menu', 'remove_wp_logo', 999 );

function remove_wp_logo( $wp_admin_bar ) {
   $wp_admin_bar->remove_node( 'wp-logo' );
}

Notice: Theme without comments.php is deprecated since version 3.0.0 with no alternative available. Please include a comments.php template in your theme. in /data/sites/web/bdwmbe/www/wp-includes/functions.php on line 4486

Comments are closed.