WooCommerce User Role Builder
Build a custom WordPress role with exactly the WooCommerce capabilities it needs, using the same capability set WooCommerce grants Shop Manager.
Your details
Your snippet
<?php
/**
* Add a custom WooCommerce staff role: "Store Assistant".
* Runs once (guarded by get_role()), so it's safe to leave in a site-specific plugin.
*/
add_action( 'init', 'ea_add_role_store_assistant' );
function ea_add_role_store_assistant() {
if ( get_role( 'store_assistant' ) ) {
return;
}
add_role(
'store_assistant',
__( 'Store Assistant', 'woocommerce' ),
array(
'read' => true,
'edit_product' => true,
'read_product' => true,
'delete_product' => true,
'edit_products' => true,
'edit_others_products' => true,
'publish_products' => true,
'read_private_products' => true,
'delete_products' => true,
'delete_private_products' => true,
'delete_published_products' => true,
'delete_others_products' => true,
'edit_private_products' => true,
'edit_published_products' => true,
'manage_product_terms' => true,
'edit_product_terms' => true,
'delete_product_terms' => true,
'assign_product_terms' => true,
'edit_shop_order' => true,
'read_shop_order' => true,
'delete_shop_order' => true,
'edit_shop_orders' => true,
'edit_others_shop_orders' => true,
'publish_shop_orders' => true,
'read_private_shop_orders' => true,
'delete_shop_orders' => true,
'delete_private_shop_orders' => true,
'delete_published_shop_orders' => true,
'delete_others_shop_orders' => true,
'edit_private_shop_orders' => true,
'edit_published_shop_orders' => true,
'manage_shop_order_terms' => true,
'edit_shop_order_terms' => true,
'delete_shop_order_terms' => true,
'assign_shop_order_terms' => true,
)
);
}These are the same WordPress capability groups WooCommerce grants to Shop Manager (edit, read, delete, publish and the taxonomy caps for each post type), so this role behaves like a narrower Shop Manager rather than a made-up permission set.
To remove this role later, run remove_role( 'store_assistant' ) once; reassign any users on it first, since they'll otherwise lose their role entirely.
Where WooCommerce's capabilities come from
WooCommerce registers its own capabilities for three post types (product, shop_order, shop_coupon), each with the full WordPress capability set for that type: edit, read, delete, edit others', publish, read private, delete private/published/others', plus manage/edit/delete/assign for its taxonomy terms. On install, WooCommerce grants every one of these to the built-in administrator and shop_manager roles.
This tool builds a new role from the same capability groups, so you can grant, say, only Orders and Coupons to a returns-desk role, without giving them Settings or full Product access the way Shop Manager does.
| Group you toggle | WordPress capability type it grants |
|---|---|
| Products | product (edit_products, publish_products, edit_product_terms, …) |
| Orders | shop_order (edit_shop_orders, read_private_shop_orders, …) |
| Coupons | shop_coupon (edit_shop_coupons, delete_shop_coupons, …) |
Adding the role
- 01
Paste the snippet
Add it to a site-specific plugin (roles created by a theme's functions.php disappear if you switch themes).
- 02
Load the page once
add_role()only needs to run once; the snippet checksget_role()first so it's safe to leave in place. - 03
Assign the role
Go to Users → All Users, edit a user, and pick the new role from the Role dropdown.
This role can log into wp-admin (it includes read) but starts with none of WordPress's own post/page/media capabilities. If the person also needs to edit pages or upload media, add those roles' capabilities too, or start from editor instead of a blank role.
Questions people ask
Why can't my new role see the Orders menu at all?
Make sure “Orders” is toggled on, and log the user out and back in, or reset the admin menu cache, since WordPress caches menu visibility per-session in some setups.
Does this role automatically get WooCommerce Settings access?
No, that's the separate “Change WooCommerce settings” toggle (manage_woocommerce), since it's a much wider capability than day-to-day order and product work.
Can I remove a role I created with this tool?
Yes, with remove_role( 'your_role_key' ), run once the same way. Existing users on that role fall back to no role, so reassign them first.
Is this the same as WooCommerce's own Shop Manager role?
Shop Manager gets every one of these capability groups plus broader WordPress capabilities (managing most content, uploading files). Use this tool when you want less access than Shop Manager, for a narrower staff role.
Related tools
Last reviewed 30 September 2026.
