Restrict pages based on permissions assigned to pages and granted in user profiles.
This plugin allows you to easily mark certain pages with “Permissions” and only users with those permissions will be allowed to see the contents of the page.
Page Permissions: This plugin adds a new Permissions taxonomy to your pages. Administrators can create/assign new permissions from the Edit Page screen (you can also use the Quick Edit link). You can add/edit/delete permissions from the Permissions sub-menu under the Pages menu. Pages with no assigned permissions can be seen by everyone.
User Permissions: Administrators can add/remove permissions from a user using the checkboxes on the Edit User screen. The All Users page has a column that shows the permissions assigned to each user.
Restriction Message: If a page has permissions assigned, the content will only be visible to users that have one of those same permissions assigned. Otherwise, the content will be replaced by a generic message or a custom message which can be defined in the plugin settings using the standard WordPress editor (including the ability to add media and formatting).
Redirect to login: Instead of a restriction message, you can choose to have users get redirected to the login page.
simple-restrict.zip
to the /wp-content/plugins/
directoryNew Permissions taxonomy added to pages
Permission management screen
Permissions metabox on the Edit Page screen
Permissions being added using page Quick Edit
Permissions column in the Users screen
Permissions assigned on the New User screen (and permissions can be edited for existing users)
Settings page where you can change the message that appears on restricted pages (including the ability to add media and formatting). Note: You can now also choose to redirect the user to the login page instead of showing the restriction message.
Go to the Edit Page screen for the page you want to restrict, and find the new “Permissions” section. Create and assign a new permission (e.g. “Gold subscriber”) and update your page. Now this page content will only be viewable by users who have this same permission assigned to them.
If a page is restricted, it’s content will only be viewable by users who have this same permission assigned to them. To assign a permission to a user, go to the Edit User page and you will see all possible permissions listed. Put a checkmark beside the Permissions you want to assign to this user. Save the changes, and the user will be allowed to see the page.
A user only needs to have one of the page permissions assigned to her/him in order to see that page. For example, if a page is assigned the permission “Gold subscriber” and another permission “Silver subscriber”, a user who is assigned the permission “Silver subscriber” will see the page.
They are visible to everyone.
No. This plugin is only for pages.
It depends. If your page template uses the_content() to retrieve the main content, and does not loop through any posts, then yes this plugin will restrict the page. Otherwise, see the answer below.
No. This plugin hides the main content of the page (the_content()). Any page template that loops through posts, be they default posts or custom post types, will continue to show those posts. A more advanced content restriction plugin (usually paid) would be required for your needs.
The manage_options capability is required to edit plugin settings.
The edit_users capability is required to assign permission to users.
Any user who has the rights to edit a page also has the rights to assign permissions to the page and create new permissions.
The plugin is on GitHub, feel free to submit a pull request.
This plugin was released in English and French, and anyone can add additional translations from here.
Fixed: Security issue