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:
- In the WordPress admin, go to Plugins > Add New and search for ‘User Role Editor’.
- Install and activate the plugin.
- Go to Users > User Role Editor.
- In the ‘Select Role and change its capabilities:’ dropdown, select the user role that you want to access private categories.
- Tick the ‘Show capabilities in human readable form’ box.
- 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
- Scroll up and click ‘Update’.
- 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.
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.