- How to Install SureDash
- Download and Access Your SureDash License
- How to Update SureDash
- Understanding Spaces and Space Groups in SureDash
- How to Add a Space Content Type in SureDash
- How to Set Up a SureDash Course Space
- How to Set Up Google Login in SureDash: A Step-by-Step Guide
- How to Set Up Facebook Login in SureDash: A Step-by-Step Guide
- Understanding the Customize Portal in SureDash
- How To Add a Logo To The SureDash Portal
- Setting up Space Groups
- Hidden Spaces in SureDash
- How to Create a Feed Space
- How to Set up “Course” space in SureDash?
- How to Create a “Discussion” Space in SureDash
- How To Set Up A Private Discussion Space In SureDash
- Creating a “Single Post/Page” Space in SureDash
- How to Set Up a “Link” Space in SureDash
- How to Configure SureDash Space Layouts
- Understanding the “Single Post/Page” Space Type in SureDash
- How to set up Giphy Integration?
- How to Set up Presto Player with SureDash
- SureDash & SureMembers Integration: How to Restrict Access to Spaces and Content
- How to Integrate SureCart with SureDash
- How to Integrate OttoKit with SureDash
- Kadence Theme Compatibility with SureDash
- Using Media Offloading in SureDash
- How to Translate SureDash into Another Language
- How to Set Up and Award Badges in SureDash
- How to Regenerate the Default SureDash Pages
- Recommended Hosting for SureDash
- Customizing the Portal Slug Using a Filter
- How to Edit SureDash Space or Post with Any Page Builder
- How to Use the Profile URLs in SureDash
- How to Manage Navigation Sidebar Top Sticky Offset in SureDash
- Custom Classes Used in Site Editor and Their Purpose
- How to Reset the Portal Template in SureDash?
- Media Handling in the Resource Library
- Location Where Users Can View Their Accessed Resources in SureDash
- How to Refresh / Flush WordPress Permalinks?
- How To Migrate From Alpha To Final Version
- Presto Player Not Working in SureDash?
- SureDash v1.3.0 Release Compatibility Notes
- Troubleshooting Portal Layout Issues in SureDash with Astra Theme
- Using SureDash and LifterLMS Lessons Together
- Why Some Strings Are Not Translating in SureDash
- How to Add Custom Fields to the User Profile in SureDash
- Understanding Slugs in SureDash
- How to Restrict Any Space or Post from SureDash?
- How to Customize Community Content Post Slugs in SureDash
- How to Customize User Profile Fields and Social Links in SureDash v1.5.0
- How to Add Custom Notifications in SureDash
- Customizing Email Templates in SureDash and SureDash Pro
- How to Hide Admins or Specific Users from the Member Directory
- How to Create Custom Extensions and Add Custom Options in SureDash
- How to Restrict Any Space or Post from SureDash?
- Customize Side Navigation Icons Conditionally
- SureDash Developer Hooks
- SureDash Course Progress Hooks
- How to Add Custom Notifications in SureDash
- Customizing Email Templates in SureDash and SureDash Pro
How to Hide Admins or Specific Users from the Member Directory
The Member Directory in SureDash displays a list of registered members in your portal. By default, it shows all users, including administrators and portal managers.
If you want to control who appears in the directory, SureDash provides two filters that let you hide specific users or user roles without any manual configuration.
This guide covers both available filters and how to add them to your site.
Snippet 1: Hide All Administrators and Portal Managers
Use this filter when you want only regular members (the suredash_user role) to appear publicly in the directory, keeping staff accounts out of the roster.
1. Copy the Filter Code
<?php
/**
* Hide administrators and portal managers from the SureDash Member Directory.
*
* Useful when you want only members (suredash_user role) to appear publicly,
* keeping staff accounts out of the roster.
*/
add_filter( 'suredash_membership_directory_exclude_admins', '__return_true' );
Snippet 2: Hide Specific Users by User ID
Use this filter to exclude individual users by their WordPress user ID. This is useful for hiding test accounts, bots, or any profile that should not appear in the directory.
1. Copy the Filter Code
<?php
/**
* Exclude specific users from the SureDash Member Directory.
*
* @param int[] $user_ids Existing list of user IDs to exclude.
* @return int[] Updated list of user IDs to exclude.
*/
add_filter( 'suredash_membership_directory_excluded_user_ids', function ( $user_ids ) {
// Replace 12 and 47 with the user IDs you want to hide.
return array_merge( $user_ids, [ 12, 47 ] );
} );
Replace 12 and 47 with the actual WordPress user IDs you want to hide. You can find a user’s ID under Users in your WordPress admin.
2. Add the Code to Your Site
To safely add either snippet, use a custom code plugin or your theme’s functions.php file. We recommend using the Code Snippets plugin.
Steps:
- Go to Plugins > Add New, search for Code Snippets, and install it.
- Go to Snippets > Add New.
- Give the snippet a title, such as Hide Admins from Member Directory.
- Paste the code from above.
- Click Save Changes and Activate.
For more details, follow this guide: How to Add Custom PHP Code to Your WordPress Site
Conclusion
That’s it! With these two filters, you have full control over who appears in the SureDash Member Directory. Use the first filter to hide all admins and portal managers at once, or use the second to target specific user IDs.
We don't respond to the article feedback, we use it to improve our support content.