I am working on a site where I want to show customers a demo-version of a product. To do this they can login with a guest-account, I have created this role as follows

add_role('guest', __('Guest'),
          'read'    => true

When I login as a guest I get redirected to and get to see the overview-page /admin.php?page=my_overview, so this does work, but when the guest clicks on any item in this overview I get a message saying: You don't have permission to access this page.

These items refer to pages like: /profile.php /edit.php /users.php /admin.php Since using these pages is a basic part of my products functionality, I want to grant the guest account access to these pages, but don't let them insert/update/delete any data which is shown on those pages.

I have tried adding multiple different privileges i.e. edit_posts, edit_private_posts, edit_private_pages, read_private_posts, read_private_pages, but I can't get it to work right.

I would like to achieve this guest account with specific permissions without the use of any plugin. Basicly I want to create a user that can do the same as an Author, but without any INSERTs/UPDATEs/DELETEs on my demo-site to the database

I don't know if it is even possible, but any help would be appreciated.

1 Answer 1


After you've created the new role, you need to add the capability to it using add_cap. Check here for more info: https://codex.wordpress.org/Function_Reference/add_cap

I think that for your particular case, you could replicate an Author but then remove certain capabilities using remove_cap https://codex.wordpress.org/Function_Reference/remove_cap

  • Thanks for you answer, I just figured it out myself too, wanted to update my question that I was missing the part about adding capabilities, but thanks for the links, will check it out.
    – K. Tromp
    May 11, 2017 at 11:48

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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