Community
Administrator
Staff member
We often make it so the shop manager role in Woocommerce is specifically for managing the shop, so we remove all the other clutter and have seperate Admin accounts for people who need the more advanced settings.
More often than not, the Elementor Templates menu remains in place. The code below demonstrates how we remove certain post types, the elementor template menu and the Tools and themes menus, specficially just for the Shop manager role.
Add the following to your functions.php, or your code snippet plugin.
More often than not, the Elementor Templates menu remains in place. The code below demonstrates how we remove certain post types, the elementor template menu and the Tools and themes menus, specficially just for the Shop manager role.
Add the following to your functions.php, or your code snippet plugin.
PHP:
function hide_menu_items_for_shop_manager(){if (is_admin() && current_user_can('shop_manager')){remove_menu_page('edit.php?post_type=listing');
remove_menu_page('edit.php?post_type=reviews');
remove_menu_page('edit.php?post_type=packages');
remove_menu_page('edit.php?post_type=services');
// Elementor Templates menu, sometimes requires removing the 'elementor_library' post type
remove_menu_page('edit.php?post_type=elementor_library');
remove_menu_page('tools.php');
remove_menu_page('themes.php');
}
}
add_action('admin_menu', 'hide_menu_items_for_shop_manager', 1000);