WordPress Development Stack Exchange is a question and answer site for WordPress developers and administrators. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I am considering using WordPress for a number of users in overlapping groups, e.g. a user may be in group A and group B, or only group A.

Is it possible to use WordPress to limit access to particular Pages. e.g. Only members of group B can view this page, only members of groups A and C can view that page.

Would this permission extend to the menu item linking to the page? (e.g. if user can't view page, they can't see the menu tab/menu item)

share|improve this question
Yes, it is possible but not everything required is built in. Check out the available plugins, think though what you need in detail, get started, and come back with more specific questions about the actual code. – s_ha_dum Apr 12 '13 at 14:06

That's an interesting question. You could probably Create Custom Roles and use Roles and Capabilities ( codex.wordpress[dot]org/Roles_and_Capabilities ) to your advantage.

You might also be able to add Custom Fields To each User ( wpengineer[dot]com/2173/custom-fields-wordpress-user-profile ) that could help you achieve this goal.

This bit of code below might be helpful as you research. Entering this code in your functions.php file you can restrict a user with a specified capability from accessing the admin area. As you can see below using current_user_can('capability') you can create a function or use an existing function. Then all you need to do is hook into the action that you need.

    /*********************  Restrict Admin Area to only Admins **********************/
function restrict_admin()
    if ( ! current_user_can( 'manage_options' ) ) {
                wp_redirect( site_url() );
add_action( 'admin_init', 'restrict_admin', 1 );

Good luck!

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

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