I've been having a difficult time adding custom post type capabilities to roles (Adding capabilities to default roles) and I suspect that my muddling around may have caused some problems. I also have installed and de-installed various plugins some of which added capabilities. As a result My WP Role object is a bit of a mess. Does anyone know of a way to reset capabilities or do I need a fresh install?
I use User Role Editor. You can delete added roles, and reset roles from the plugin page.
To reset the administator role, you can, as of WP 3.4+, add
to your wp-config.php file. After having done so, you need to go to Users > User Role Editor and click "Reset".
I find an easier way 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.