WordPress Development Stack Exchange is a question and answer site for WordPress developers and administrators. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

How to create new role with same capabilities of existing role. Eg: I would like to create a new role with same capabilities of administrator or editor and so on..

share|improve this question
What have you tried? What worked? What didn't? Have you tried Members Plugin? Or Capability Manager Plugin? Do they do the things you want? – soulseekah Oct 19 '11 at 5:42
You can use User Role Editor if you want to do everything visually :) – user9567 Oct 19 '11 at 10:57
up vote 19 down vote accepted

Try this... This should work.

add_action('init', 'cloneRole');

function cloneRole()
    global $wp_roles;
    if ( ! isset( $wp_roles ) )
        $wp_roles = new WP_Roles();

    $adm = $wp_roles->get_role('administrator');
    //Adding a 'new_role' with all admin caps
    $wp_roles->add_role('new_role', 'My Custom Role', $adm->capabilities);

Check it.

share|improve this answer
Watchout!! this seems to clone the role before the plugins add roles and capabilities. I'll try admin_init to see if this is better. – spankmaster79 Jan 21 '14 at 17:21
@spankmaster79 Yes please, that will be great! – Rutwick Gangurde Jan 22 '14 at 6:00
@RutwickGangurde didn't work any better. Role is still ignored by the plugin – spankmaster79 Jan 24 '14 at 15:42

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

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