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

I was just adding a custom role by using the add_role() function. Here is the code below:

add_role('user', 'User', array('read'));

I figured this would give the same level of access as the subscribers role. Technically I want them to be the same but I don't want to use the subscribers as a role for certain users because there will be different access between the two.

However, although, from what I read on the wordpress codex site, the subscribers has only one capability and that is to 'read' it has access to the dashboard and can edit their own profile. My custom role cannot. I get the following message when going to the admin panel.

You do not have sufficient permissions to access this page.

Why is that? Hoe do get the right permissions to do this?

Thanks, Joe

share|improve this question
up vote 3 down vote accepted

You have to give the capability a true or false, like this:

add_role('user', 'User', array( 'read' => true ));

To fix it, first remove the role and than re-add it again.

add_role('user', 'User', array('read' => true));


share|improve this answer
Thanks Rob. Sorry I actually did set the capability to true on my second attempt at trying to resolve the issue. I just edited it a few times and went back to how I had it before. I guess because I screwed up the first time I had to remove the role and re-add it for it to register. Before when I changed 'real' => true, I guess it wasn't saving because the role was already created as array('real') from a previous attempt. – JoeMoe1984 May 9 '13 at 16:55

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.