WordPress ships with Subscriber, Contributor, Author, Editor, Administrator — five roles that fit a 2007-era blog and break the moment a real organization needs to model “this person manages WooCommerce orders but can’t touch posts” or “this freelancer can edit drafts in one category and nothing else.” The fix is not “give everyone Editor and hope” — it is understanding the capability model and extending it where the defaults stop.
What’s happening
A WordPress role is a named bundle of capabilities. A capability is a single permission like edit_posts, manage_options, upload_files. The wp_user_roles option stores the mapping; WP_User checks capabilities through user_can( $cap ). Plugins add their own capabilities (manage_woocommerce, wpcf7_edit_contact_forms), and the result on a mature site is 50-200 capabilities a user might or might not have.
The defaults break in three common ways: (1) Editor is too powerful (can edit other users’ posts in every post type); (2) Contributor is too weak (can’t upload images, breaking any post with media); (3) there is no role for “shop manager who can refund orders but not change site settings.” Plugins like WooCommerce ship their own roles to fill the gap, which works for that plugin but doesn’t compose cleanly across plugins.
How to verify
wp role list
wp cap list editor
wp user list --role=editor --fields=user_login,user_email
wp eval 'print_r( wp_roles()->roles );' | head -50
wp eval 'print_r( wp_roles()->roles["custom_role"] );'
wp user list-caps 5
Audit who has manage_options (full admin): wp user list --capability=manage_options --fields=user_login. On most sites the list should be 1-3 people. Anything above 5 is a finding worth raising.
The fix
- Use a role editor plugin, but treat it as a write tool, not a UI. Members or User Role Editor let you build custom roles, export them as code, and check them into the theme. The plugin UI is for prototyping; the resulting role definitions belong in
functions.phpor an mu-plugin. - Define roles in code, not in the database. Roles stored only in
wp_optionsdon’t replicate to staging. Useadd_role()in a plugin activation hook (or an mu-plugin’sinitaction) so the role definition is version-controlled. - Build roles from least privilege upward. Start with
Subscribercapabilities, add only what the user needs. The instinct to clone Editor and remove capabilities leaves dangerous defaults in place. - Add granular post-type capabilities. A custom post type registered with
capability_type => 'product'createsedit_products,delete_products, etc. Map them onto specific roles instead of using the genericedit_posts. - Audit on a schedule. Run
wp user list --capability=manage_optionsquarterly. People change roles in the organization; their WordPress capabilities rarely follow. The enterprise WordPress support operating model includes quarterly access reviews as part of the standard SLA.
When the role model is fighting the editorial workflow and people are either over-privileged or constantly blocked, Stack Harbor’s enterprise WordPress support team rebuilds the role matrix from least-privilege upward — start the conversation for a role redesign pass.