1. Home
  2. Documentation
  3. General
  4. FAQ
  5. How to edit WordPress user roles to access private posts, products & categories

How to edit WordPress user roles to access private posts, products & categories

Our Password Protected Categories and WooCommerce Password Protected Categories plugins provide an option to mark categories as ‘Private’. Private categories only appear to logged in users of your WordPress website with the correct role capabilities.

By default, private categories are only visible to Administrators and Editors (plus Store Managers if you’re using WooCommerce). If you’re using private categories, you will probably want to make them available to other user roles – for example, normal subscribers or customers.

If you’re a WordPress developer then you can change the user roles programmatically. Otherwise, we recommend using the free User Role Editor plugin. The following video tells you how to do this, or you can read the written instructions below:

How to edit WordPress user roles and give access to private content

  1. In the WordPress admin, go to Plugins > Add New and search for ‘User Role Editor’.
  2. Install and activate the plugin.
  3. Go to Users > User Role Editor.
  4. In the ‘Select Role and change its capabilities:’ dropdown, select the user role that you want to access private categories.
  5. Tick the ‘Show capabilities in human readable form’ box.
  6. Lower down, you will see an alphabetical list of all the WordPress user role capabilities. Scroll down to the ‘R’ section and tick the following boxes. (Depending on your plugins, you may not see all these boxes, and there may be similar ones that you need to tick too. Don’t worry about this – just tick the boxes that apply to your site):
    • Read private pages
    • Read private posts
    • Read private products
  7. Scroll up and click ‘Update’.
  8. Create a private category, login as a user with the role you just edited, and check they can view the category ok.

Tip: If you get a 404 error, this means that the user doesn’t have access to the private category. Go back and check your changes, e.g. make sure you edited the correct role.

Edit WordPress user roles for private categories, posts and products

How can I create password protected categories in WordPress?

Once you’ve given your users access to private content, you need to mark the relevant content as private. Private pages, posts and individual custom posts are already built into WordPress. To mark entire WordPress categories as private, and all the posts within them, you need our Password Protected Categories or WooCommerce Password Protected Categories plugin.

Was this article helpful?

Related Articles