
If you’re managing a multi-user WooCommerce store, sometimes you want to limit backend access for Shop Managers — especially to avoid accidental deletions or unwanted edits. A common use case is allowing Shop Managers to only manage products, without giving them access to orders, coupons, settings, or even the ability to delete products.
In this post, we’ll show you how to:
✅ Display only the “Products” menu for Shop Managers
✅ Hide the delete/trash button from the product list and edit screens
✅ Keep your product management safe and secure
🎯 Why Restrict Shop Manager Access?
The shop_manager
role in WooCommerce is quite powerful by default. It can:
-
Access Orders, Products, Coupons, and Reports
-
Manage WooCommerce settings
-
Delete products and other content
But for many businesses, Shop Managers should only handle product listings, without touching orders or deleting items.
🧩 Step-by-Step Solution: Code You Can Use
Place the following code in your theme’s functions.php
file or a custom plugin.
✅ 1. Show Only the “Products” Menu
This code limits the WordPress admin menu so that Shop Managers can only see Products.
Trash/Delete links and buttons are gone for products.
// 1. Show only “Products” menu for Shop Manager
add_action( ‘admin_menu’, ‘limit_menu_to_products_for_shop_manager’, 999 );function limit_menu_to_products_for_shop_manager() {
if ( current_user_can( ‘shop_manager’ ) ) {
global $menu;// Allow only this menu item
$allowed = [
‘edit.php?post_type=product’, // Products
];foreach ( $menu as $key => $item ) {
$slug = isset( $item[2] ) ? $item[2] : ”;
if ( ! in_array( $slug, $allowed ) ) {
remove_menu_page( $slug );
}
}
}
}// 2. Remove “Move to Trash” from product list actions
add_filter( ‘post_row_actions’, ‘remove_trash_link_for_shop_manager’, 10, 2 );function remove_trash_link_for_shop_manager( $actions, $post ) {
if ( current_user_can( ‘shop_manager’ ) && $post->post_type == ‘product’ ) {
unset( $actions[‘trash’] );
}
return $actions;
}// 3. Remove “Move to Trash” button from product edit screen
add_action( ‘admin_footer-post.php’, ‘remove_trash_button_on_edit_screen’ );
add_action( ‘admin_footer-post-new.php’, ‘remove_trash_button_on_edit_screen’ );function remove_trash_button_on_edit_screen() {
global $post;
if ( current_user_can( ‘shop_manager’ ) && $post && $post->post_type === ‘product’ ) {
echo ‘‘;
}
}