0

any way would be acceptable for me, even hacking the DB.

I have messed up the roles with MEMBERS plugin, and i need a way of reseting the roles somehow. i can't seem to find a proper way.

basically, I need to flush all roles, capabilities, and custom post type at once. it wouldn't cause any trouble with the one's who are written to the functions.php file, as i understand, - right?

4 Answers 4

3

The easiest way I know to reset roles and their associated capabilities is to use wp-cli.

wp-cli has a built-in method for resetting roles. You can specify any that you want to reset. For example:

wp role reset author contributor editor subscriber

There is also an --all flag, which you can use like this:

wp role reset --all

Warning that this will include resetting the administrator capabilities, which may remove access to some plugins, so use with caution.

1
  1. Deactivate the Plugin
  2. Go to Dashboard > Users
  3. Select all users
  4. Select the desired role from the "Change role to" dropdown
  5. Click "Change"

Plugins can't really do any permanent damage, provided that all of their actions are implemented properly via the Plugin API. I assume the Members Plugin fits this description. So, once you deactivate it, any changes it has made to core user roles should be reverted. Then, you simply need to reassign existing users to the desired, core user role.

2
  • 2
    that would be great but that is not true. user roles do stay after deactivating the plugin and changing users roles. :( Apr 20, 2012 at 22:03
  • 1
    @Chip: This is not correct. Try $wp_roles->remove_cap('editor', 'edit_others_posts'); in your functions.php, a mu-plugin, whatever. Then remove it. The capability is permanently removed. Well, permanent until you manually add it back.
    – akTed
    Jan 14, 2013 at 4:44
1

You can delete or add again the Roles and/or the Capabilities:

1
  • i'm looking for something more complete like a script that is running through all roles and capabilities and reset them to default... this would be great. Apr 20, 2012 at 17:44
0

Update for others asking.

Although members has not messed up I'd prefer to use AAM however there doesn't look to be an option to reset within members (there is reset in AAM).

There is one plugin which does just this specifically. https://wordpress.org/plugins/reset-roles-and-capabilities/

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.