Reset default roles and capabilities of WordPress

Vu Nam Hung
Vu Nam Hung
Published in
1 min readDec 19, 2019

If you don’t want to install a plugin to just to do this one task, you can call the WordPress function directly to rebuild the roles and their capabilities.

if ( !function_exists( 'populate_roles' ) ) {
require_once( ABSPATH . 'wp-admin/includes/schema.php' );
}
populate_roles();

--

--