How to Fix Shop Manager Role Cannot Edit Users in WordPress
Content
A common issue for WordPress site administrators, particularly those running WooCommerce, is discovering that users with the Shop Manager role cannot edit other users' profiles, even after all the correct capabilities like edit_users and list_users have been granted using the User Role Editor plugin. This guide explains why this happens and provides the definitive solution.
Why This Problem Occurs
This is not a bug in the User Role Editor plugin. The behavior is a deliberate security feature implemented by WooCommerce. Starting with version 3.4.6, WooCommerce introduced a restriction that limits Shop Managers to editing only users with the 'customer' role. This was a security update to prevent potential privilege escalation.
Even if you grant a Shop Manager every user-related capability, WooCommerce's internal code will still filter and restrict which user roles they can see and edit. This is why the role dropdown may appear empty or only show 'customer' when a Shop Manager tries to change a user's role.
The Primary Solution: Use the WooCommerce Filter
The WooCommerce team provides an official filter hook to override this restriction. You must add a small code snippet to your site, typically by placing it in your child theme's functions.php file or using a code snippets plugin.
The following code example adds the 'subscriber' and a custom 'vendor' role to the list of roles a Shop Manager can edit. You can modify the array to include any role slugs you need.
add_filter( 'woocommerce_shop_manager_editable_roles', 'my_shop_manager_editable_roles' );
function my_shop_manager_editable_roles( $roles ) {
// Add the slugs of the roles you want the Shop Manager to edit
$roles[] = 'subscriber';
$roles[] = 'vendor';
return $roles;
}
Important: After adding this code, the Shop Manager will need the standard WordPress capabilities (list_users, edit_users, promote_users, etc.) to perform these actions, which can be granted via the User Role Editor interface.
Alternative Workarounds
If you are uncomfortable adding code, there are two other potential approaches, though they come with caveats:
- Create a Custom Role: Instead of modifying the built-in Shop Manager role, create a new role (e.g., "Shop Man 2") that is a copy of it. Then, grant this new role the necessary user editing capabilities. Be aware that this custom role will not automatically receive new capabilities that WooCommerce may add to the official Shop Manager role in future updates.
- Assign Multiple Roles: You can assign a single user both the Shop Manager role and a second custom role that has the user editing capabilities. This can be a complex setup but avoids modifying the core Shop Manager role.
Important Considerations
- WooCommerce Resets Roles: Be aware that WooCommerce will reset its own roles (like Shop Manager) to their default capabilities if the plugin is reactivated. If you make direct changes to the Shop Manager role, they could be lost. Using the filter hook or a custom role is the more sustainable solution.
- Plugin Conflicts: The ability to see and edit custom user profile fields (added by plugins like User Registration Pro) may be controlled by that specific plugin's permissions, which are separate from WordPress core capabilities.
By using the provided filter, you can confidently extend the Shop Manager's permissions to manage users while maintaining the security and update path of your WooCommerce store.
Related Support Threads Support
-
create_user rightshttps://wordpress.org/support/topic/create_user-rights/
-
Shop Manager unable to cahange user rolehttps://wordpress.org/support/topic/shop-manager-unable-to-cahange-user-role/
-
possible bughttps://wordpress.org/support/topic/possible-bug-29/
-
Add sub group to custom permission.https://wordpress.org/support/topic/add-sub-group-to-custom-permission/
-
Let user change other users user rolehttps://wordpress.org/support/topic/let-user-change-other-users-user-role/
-
Admin tool bar itemshttps://wordpress.org/support/topic/admin-tool-bar-items/
-
Cannot edit user in specific role even capabilities assignedhttps://wordpress.org/support/topic/cannot-edit-user-in-specific-role-even-capabilities-assigned/
-
Other Roles – Allowing another type to modifyhttps://wordpress.org/support/topic/other-roles-allowing-another-type-to-modify/
-
How To Give Permission To Add New Order From Admin Panelhttps://wordpress.org/support/topic/how-to-give-permission-to-add-new-order/
-
user rolehttps://wordpress.org/support/topic/user-role-56/
-
How to let allow a role to edit other users’ profileshttps://wordpress.org/support/topic/how-to-let-allow-a-role-to-edit-other-users-profiles/
-
Analytics access for custom user rolehttps://wordpress.org/support/topic/analytics-access-for-custom-user-role/
-
After WC update, Shop Managers can only edit users with the Customer rolehttps://wordpress.org/support/topic/after-wc-update-shop-managers-can-only-edit-users-with-the-customer-role/
-
How to give edit user permission for a specific role in User Roleshttps://wordpress.org/support/topic/how-to-give-edit-user-permission-for-a-specific-role-in-user-roles/
-
Translate roles permissionshttps://wordpress.org/support/topic/translate-roles-permissions/
-
Right to add couponhttps://wordpress.org/support/topic/right-to-add-coupon/
-
Allow shop manager to assign roleshttps://wordpress.org/support/topic/allow-shop-manager-to-assign-roles/
-
Shop manager can’t edit users anymorehttps://wordpress.org/support/topic/shop-manager-cant-edit-users-anymore/
-
User Permissionshttps://wordpress.org/support/topic/user-permissions-52/
-
Hide global addon from shop manager rolehttps://wordpress.org/support/topic/hide-global-addon-from-shop-manager-role/
-
New user role with capabilities of Shop Manager” role+ Add new/Edit users?https://wordpress.org/support/topic/new-user-role-with-capabilities-of-shop-manager-role-add-new-edit-users/
-
Restricting Shop Manager Rolehttps://wordpress.org/support/topic/restricting-shop-manager-role/
-
How to let the shop manager see the subscriber and customer user additional infohttps://wordpress.org/support/topic/how-to-let-the-shop-manager-see-the-subscriber-and-customer-user-additional-info/
-
Add user backendhttps://wordpress.org/support/topic/add-user-backend-2/
-
Why permissions change by themselves ?https://wordpress.org/support/topic/why-permissions-change-by-themselves/
-
Language conflicthttps://wordpress.org/support/topic/language-conflict/
-
Change snot taking effecthttps://wordpress.org/support/topic/change-snot-taking-effect/