Roleline documentation1.x
Help

Troubleshooting

Locked out, changes that don't save, missing capabilities and other common problems.

I can't open Users → Roles any more

Someone (or another plugin) took away Roleline's capability, or what administrators need. Roleline itself never lets you remove these from yourself.

  • With WP-CLI: wp roleline restore --yes puts the latest backup back. wp roleline backups lists them if you need an older one.
  • Without WP-CLI: add define( 'ROLELINE_REPAIR', 'your-user-name' ); to wp-config.php, load any page, then remove the line. Your Administrator role gets every WordPress capability back, and you get the Administrator role.

If no role has Roleline's capability at all, administrators get it back automatically on their next admin page.

"Changes can't be saved: roles are defined in code"

Your site sets the $wp_user_roles global (often in wp-config.php or a must-use plugin), so WordPress ignores the roles in the database. Change the roles in that code instead.

A change was refused

The message says why:

  • "This would take away your own … capability" / "This would take away capabilities you have yourself": the change would lock you out, or leave you unable to undo it. Ask another administrator to make it, or give yourself the capability through another role first.
  • "This role has … users, too many to move in one go here": delete it with wp roleline delete <role> --reassign=<role>.
  • "That user isn't a member of this site" / "Only a super admin can change a super admin's roles" (multisite): add the user to the site first, or ask a super admin.
  • "You can only grant capabilities you have yourself" / "You can't change roles that have capabilities you don't have": you manage roles but aren't an administrator. An administrator can make the change.
  • "The Administrator role can't be deleted": it never can.

A capability isn't in the list

The list shows WordPress's capabilities, those of registered post types and taxonomies, those any role has, and custom ones. A plugin that only checks a capability (without giving it to a role) isn't detected: add it with Add capability.

A capability is in the wrong group

Roleline groups other plugins' capabilities by their names. If one lands in Other, the plugin's author (or you) can place it with the roleline_capability_group filter.

A user still can't do something

  • Check all of the user's roles: with several roles, a role that denies a capability (shown as "denied" in the editor) wins if it comes later.
  • Some screens need more than one capability: the Users screen needs list_users, editing others' posts needs edit_posts and edit_others_posts.
  • WooCommerce sends users without edit_posts, manage_woocommerce or view_admin_dashboard from the dashboard to My Account.
  • Multisite: some capabilities are for super admins only.

The profile still shows WordPress's Role dropdown

Roleline replaces it with JavaScript. If JavaScript is off (or another script failed), both appear; the Roles checkboxes are what's saved.

The review before saving doesn't open

It's loaded from the REST API. If that's blocked (a security plugin, for example), Save still works: Roleline checks the change on the server and shows a confirmation screen if needed.

After deactivating Roleline Pro

Its rules aren't applied while it's inactive: Users → Roles lists what's affected. See FAQ.