0

I have a site that I've inherited and my user base is requesting a feature. The page is primarily informational about a non-profit (calendar of events, contact form, etc.) but they'd like to add a page plus some posts that contain information which only a small group of people have access. This area of the site contains sensitive information (personally identifying but nothing about payments etc.). It's more along the lines of monthly meeting notes from the board of directors.

I've looked around and most plugins or solutions are seen are geared either toward password protected post content (which is not what I need) or password protecting the entire site (which is not what I need).

Before I begin looking at rolling my own plugin, is there something similar out there that might work?

1
  • 1
    "protected post content (which is not what I need)" - to me, it sounds exactly like what you need. An alternative would be to let everyone have a user and that page only be accessible to users of that group.
    – kero
    Commented Oct 26, 2021 at 14:55

1 Answer 1

1

If you're looking to restrict the ability to view pages or posts to those that have a specific role, you can use the method described here: https://wpti.ps/check-if-user-has-specific-role-or-capability-in-wordpress/

You could create a custom role for those that need access and then check for that role using the custom function in the link above. If going that route, I'd implement a custom post type as well specifically for that type of content, then create a template for the post type that ensures that content is always displayed with the role check.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.