![](https://d2be3atgmh2lyq.cloudfront.net/wp-content/uploads/2019/08/LearnDash-Visibility-Control-343x355.png)
Free
Key Controls
Visibility Control for LearnDash LMS addon helps you hide messages and content for specific criterion anywhere on your WordPress page.
Login Status
Show/Hide HTML elements, menus, and other details based on user’s status like logged in or logged out.
Access to Course
Show/Hide HTML elements, menus, & other details based on user’s course enrollment & completion.
Group Member
Show/Hide HTML elements, menus, and other details by checking LearnDash group’s membership.
User Role
Show/hide HTML elements to users having a certain role. Ex: administrator, subscriber and student.
How to Use?
You simply need to add a CSS class to your element div or span.
As explained here, if Course or Group ID is 123
Login/Logout Status
Show element to a logged-in user
Add this CSS class: visible_to_logged_in OR hidden_to_logged_out
Hide element from a logged-in user
Add this CSS class: visible_to_logged_out OR hidden_to_logged_in
For all the Courses
Show element to user with access to all Courses
Add this CSS class: visible_to_course_all
Hide element from user with access to all Courses
Add this CSS class: hidden_to_course_all
Show element to users not enrolled in any Course
Add this CSS class: visible_to_course_none
Hide element from users not enrolled in any Course,
Add this CSS class: hidden_to_course_none
For a specific course
Example Course ID: 123
Show element to user enrolled in course
Add this CSS class: visible_to_course_123
Hide element from user enrolled in course,
Add this CSS class: hidden_to_course_123
For users with access to at least one course, add this CSS class: hidden_to_course_none
For Course Completion
Example Course ID: 123
Show element to user who completed the course
Add this CSS class: visible_to_course_complete_123
Hide element from user who completed course
Add this CSS class: hidden_to_course_complete_123
Show element to user who has not completed the course
Add this CSS class: visible_to_course_incomplete_123
Hide element from user who has not completed the course
Add this CSS class: hidden_to_course_incomplete_123
For all the groups
Show element to user with access to all groups
Add this CSS class: visible_to_group_all
Hide element from user with access to all groups
Add this CSS class: hidden_to_group_all
Show element to users not enrolled in any group
Add this CSS class: visible_to_group_none
Hide element from users not enrolled in any group
Add this CSS class: hidden_to_group_none
For a specific group
Example Group ID: 123
Show element to user with access to group
Add this CSS class: visible_to_group_123
Hide element from user with access to group
Add this CSS class: hidden_to_group_123
For users with access to at least one group, add this CSS class: hidden_to_group_none
For Specific Roles
Show element to user role administrator
Add this CSS class: visible_to_role_administrator
Hide element to user role administrator
Add this CSS class: hidden_to_role_administrator
Note:
- To show an element to multiple specific roles only, you need to add the element multiple times, one for each role.
- To hide an element/menu from specific multiple roles only you can add the element once add multiple classes to the same element.
Mechanism of Functioning
- Multiple CSS Classes: If multiple visibility control classes are added, ALL of them must meet the criterion to keep the element visible. If any one of them hides the element, it will be hidden. For example: visible_to_group_123 visible_to_group_124 will show the element only to those who have access to both groups.Hidden data/elements reach the browser. Though users do not see it.
- CSS is added to the page for all CSS elements that need to be hidden based on the above rules.
- After the page is loaded. These elements are removed from the page using jQuery (if available), so it won’t be available even on Inspect.
- Elements rendered after the page load are hidden but not removed from DOM/page.
Screenshots
![](https://d2be3atgmh2lyq.cloudfront.net/wp-content/uploads/2019/08/Course_Content_Visibility.png)
![hide menu item if user is logged-in](https://d2be3atgmh2lyq.cloudfront.net/wp-content/uploads/2020/07/screenshot-2.png)
![show menu items if user is logged-in](https://d2be3atgmh2lyq.cloudfront.net/wp-content/uploads/2020/07/screenshot-3.png)
![](https://d2be3atgmh2lyq.cloudfront.net/wp-content/uploads/2019/08/hidden_to_course.png)