Summary
By default, MemberPress integration with BuddyPress provides an all-or-nothing approach to profile protection. Users can either protect all BuddyPress profile content or leave it completely open to the public.
This article provides a solution for protecting individual member profiles while keeping the members directory publicly accessible. The solution uses MemberPress Rules with Regular Expression (regex) patterns to create selective protection for BuddyPress content.
Troubleshooting
BuddyPress Profile Protection Configuration
Issue: Need Selective Protection for BuddyPress Content
The default BuddyPress integration settings in MemberPress do not provide granular control over which BuddyPress pages are protected. This limitation prevents site administrators from creating a public members directory while protecting individual member profiles.
How to Test/Fix: Create a custom MemberPress Rule using Regular Expressions to protect only individual profile pages while leaving the members directory accessible.
Implementation Steps
- Navigate to Dashboard > MemberPress > Rules.
- Click the Add New button to create a new rule.
- In the Protected Content section, select Custom URI from the dropdown menu.
- Enable the Regex option by checking the checkbox.
- Enter the following regex pattern in the URI field:
/members/[^/]+/.*
- In the Access Conditions section, select the membership level(s) that should have access to individual profiles.
- Configure any additional access conditions as needed for your site requirements.
- Click Save Rule to implement the protection.
Understanding the Regex Pattern
The regex pattern /members/[^/]+/.* works as follows:
- /members/ – Matches the BuddyPress members directory path
- [^/]+ – Matches any username (one or more characters that are not forward slashes)
- / – Matches the forward slash after the username
- .* – Matches any additional path segments (profile tabs, activity, etc.)
Expected Results
- Public Access: [[SITE_URL]]/members/ (members directory remains accessible to all users)
- Protected Content: [[SITE_URL]]/members/[[USERNAME]]/profile/ (individual profiles require membership)
- Protected Content: [[SITE_URL]]/members/[[USERNAME]]/activity/ (activity feeds require membership)
- Protected Content: All other individual member profile sub-pages require appropriate membership access
Testing the Configuration
- Log out of your WordPress site or use an incognito browser window.
- Navigate to [[SITE_URL]]/members/ to confirm the members directory is publicly accessible.
- Click on any member’s profile link to verify that individual profiles are protected.
- Log in with an account that has the appropriate membership level.
- Confirm that member profiles are now accessible with the correct membership.
Issue: Rule Not Working as Expected
If the rule does not protect individual profiles correctly, verify the regex pattern and BuddyPress URL structure.
How to Test/Fix: Check that BuddyPress is using the default URL structure. Some sites may have custom permalink structures that require pattern adjustments.
- Navigate to Dashboard > BuddyPress > Settings.
- Review the Root Members Slug setting under the Pages tab.
- If using a custom slug other than “members”, update the regex pattern accordingly.
- For example, if using “community” as the slug, change the pattern to: /community/[^/]+/.*
Issue: BuddyPress Integration Not Enabled
The MemberPress BuddyPress integration must be enabled for proper functionality with membership rules.
How to Test/Fix: Verify that BuddyPress integration is properly configured in MemberPress settings.
- Navigate to Dashboard > MemberPress > Settings.
- Click on the Integrations tab.
- Locate the BuddyPress Integration section.
- Ensure the integration is enabled and configured according to your site requirements.
Notes
Public Facing Documentation / Additional References
Public Facing Documentation
- BuddyPress Integration with MemberPress
- MemberPress Rules Overview
- Custom URI Rules and File Protection


















