How to Restrict Access to LearnDash Menus for a User Role
We had an interesting question from one of our users who is using the LearnDash plugin for the WordPress Learning Management system.
They wanted to lock down many of the LearnDash features and create a user role role that can only access the “Lessons” and “Topics” submenus in LearnDash.
This is possible thanks to the PublishPress Capabilities Pro plugin.
In this tutorial, we will start by copying the subscriber role. This fits the customer's need since they wanted the role to have access only to the “Lessons” and “Topics” submenus.
- Copy the subscriber role and name the custom role. In this tutorial, we'll name it “Teacher”.
- When you try to log in, it will only show the Dashboard and Profile menu.
- In order to show the LearnDash menu, you will need to select the “edit course” capability located on the ‘Additional' tab.
- After adding that capability, you will see the LearnDash LMS menu.
- Now, we just need to hide all the other unnecessary menus using the “Admin Menus” feature in PublishPress Capabilities Pro.
- The screen below shows the end result. Users in this role now only have access to “Lessons” and “Topics”.
More Plugin Possibilities With PublishPress Capabilities
The PublishPress Capabilities plugin allows you to create unique roles for many kinds of plugin. For example, you can hide the Refund button in WooCommerce for some users. Or you can give Elementor users access to only a single post. If your plugin doesn't provide the access controls you need, you can probably make it happen with PublishPress Capabilities.