Allow WordPress Users to Only Read Some Pages

One PublishPress user asked us if it is possible to set up a site with this feature:

  • Joe can see only pages A, B, C.
  • Bob can see only pages D, E, F.

Yes, this is possible with the PublishPress plugins. For this, we recommend using PublishPress Permissions Pro. This is our advanced permissions plugin and allows you to customize permissions for specific users.

  • Install the PublishPress Permissions Pro plugin.
  • Install the User Switching plugin. This will help you test your new user accounts.
  • Create the user accounts you want to use. In this example, I've set up both users as “Subscribers“. This is a user role with very limited permissions, so it will be easy to configure. This is my “Users” screen with “Bob” and “Joe”:
  • Create the pages that you want to control access for. This is my “Pages” screen. I have deliberately avoided choosing either “Bob” or “Joe” as authors, because that would mess with the permissions.

Now we're going to control the permissions for these pages.

  • Edit the “A” page. This page will be visible to Joe, but not Bob.
  • Scroll down to find the “Permissions: Read this Page” box.
  • Set “Subscriber” to “Blocked”.
  • Click the “Users” tab.
  • Click “select users”.
  • Search for “joe”.
  • Select “joe”.
  • You can now set “joe” to “Enabled”.
  • Repeat this process for all six pages.
  • When you've finished, you'll see that “Read” is shown in the “Permissions” column. This lets you know that there are custom permissions for this post.

Now you can test these new permissions.

  • Go to “Users” in your WordPress admin menu.
  • Click “Switch To” for either Bob or Joe.
  • Go to the front of your site. Joe will only see pages A, B, C and Bob will only see pages D, E, F.
  • If either Joe or Bob tries to access a page they do not have access to, they will see a “Page Not Found” error.

Summary

This is a very basic example of what's possible with PublishPress Permissions Pro, with everything done manually. There are multiple ways to automate and scale these permissions. Please contact us if you're interested in a particular permissions set-up.

Here are some more advanced ideas for Permissions Pro:


Join PublishPress today

The Pro versions of PublishPress plugins are packed with extra features to help you manage your content. Get a PublishPress membership today for full access:


Steve Burge

Steve is the founder of PublishPress. Originally from the UK, he now lives in Sarasota in the USA. (P.S. This profile is generated by the PublishPress Authors plugin)

Comments (3)

  • Permissions Pro is on my top 10 favorite WordPress plugins given how much flexibility it allows admins to grant viewing/edit/revision permissions to specific people/WP-roles/custom-groups for posts, tags, and categories. You can even auto assign permissions based on tags selected, meaning if you have a way to auto add tags to a post you can change various permissions without an admin needed. One thing that would be really awesome is if there was a filter for {Authenticated} which authorizes users from a PHP filter.
    add_filter(
    ‘presspermit_authenticated_users’,
    function($authenticated) {
    // user IDs to allow users to edit, view, or revise post
    $authenticated = 1,2,3;
    })

    This would allow us to show post’s to our BuddyPress, Peepso, Ultimate Member friends by having something like $authenticated = $social_friends_ids. Privacy aside it would enable our friends to be contributors to posts we make. By having a filter to have $authenticated control which users can do an action we could then write out our own conditions to determine if the variable is used. The filter mentioned could only apply where {Authenticated} option is selected for better fine tuning.

Leave a Reply

Your email address will not be published. Required fields are marked *

Professional publishing plugins for WordPress! Get PublishPress