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

So, I'm trying to create a number of custom roles within my theme to meet with the custom requirements of the site.

The first, and most simple, being 'external viewer' who I want to simply be able to view posts (both built in and custom post-types) that someone else on the content team has created and scheduled for some point in the future.

Initially I tried this

$viewer_capabilities = array(
    'read_private_pages' => true,
    'read_private_posts' => true,
    'read' => true

add_role('external_viewer', 'External Viewer', $viewer_capabilities );

But when logging into /wp-admin I just got the 'no permission' message and I couldn't do anything. If I went to one of the scheduled posts, I just got 'not found'.

So then I tried

$role_object = get_role( 'external_viewer' );
$role_object->add_cap( 'read_private_pages' );
$role_object->add_cap( 'read_private_posts' );
$role_object->add_cap( 'read' );

Which got me a little further. I can login and see the admin dashboard, but if I visit a scheduled post, then I still get 'page not found'.

Can anyone see what I'm missing?

share|improve this question

I found Future posts are not exactly a different capability.

In WordPress Roles and Capabilities I found edit_others_posts is available by default for Super Admin, Administrator and Editor. I think it will be a right way you can proceed. (Not tested though)

And additionally try with edit_published_posts, publish_posts etc.

share|improve this answer

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.