This plugin hasn’t been tested with the latest 3 major releases of WordPress. It may no longer be maintained or supported and may have compatibility issues when used with more recent versions of WordPress.

Restrict Content by Role

Description

If you have a WordPress website with multiple users and several User Roles defined,
and you wish to prevent certain User Roles from accessing certain pieces of content
(and sub-content) both publicly and within wp-admin, then this plugin is for you.

NOTICE: We are actively developing ‘Restrict content by…’ which will eventually
replace this plugin with something that works better, and will do so much more.

The plugin provides the following functionality:

  • A meta box to allow you to set user role permissions for content and its sub-content
  • Choose if a restricted role can also view or edit that content in wp-admin
  • An option to allow content, content and sub-content or just sub content to be restricted
  • An option to allow a custom redirect URL (overriding default redirect URL settings)
  • The ability to override parent content restrictions on sub-content (including the ability to make it public)
  • Works with the CMS Tree Page View plugin
  • An options page, with the following options:
    • Choose post types that the meta box should appear on
    • Option to hide restricted pages from menu (only works when using wp_nav_menu())
    • Choose the roles that will appear in the meta box to be restricted
    • Define a login screen error message (if no custom redirect URL is set)
    • Set a custom redirect URL
    • Prevent users from adding child content to restricted content

If you are using this plugin in your project we would love to hear about it.

Screenshots

  • Meta Box to set permissions on hierarchical content
  • Meta Box on sub-content, showing override options
  • Meta Box on sub-content, overriding parent permissions
  • Options page (more options available)
  • Meta box to set admin permissions on hierarchical content
  • After admin permission set, an editor can no longer see the page in the admin panel

Installation

  1. Backup your WordPress install
  2. Upload the plugin folder to the /wp-content/plugins/ directory
  3. Activate the plugin through the ‘Plugins’ menu in WordPress
  4. Configure the plugin via the ‘Restrict Content by Role’ options page under the WordPress ‘Settings’ Menu

Reviews

Works like a charm but…

… I’m finding the documentation a little sketchy.
Works great for custom user roles and custom post types – absolutely rock solid.
One question, however:
Is there a way to restrict content on the front end globally for a specific post type?
I’m using CPTUI and ACF to create and customise my post types, and was wondering if instead of having to individually check the restrictions on every created post, somehow you could set all posts of that type to automatically be restricted.
I’m asking this because I’m using Formidable Pro to allow users to fill in a form that will allow post creation from the front end, and I want the posts to be automatically restricted.
You follow my meaning?
Keep up the great work, nice lightweight, totally functional plugin.

Nice, simple, works!

This is a very nice plugin, simple and easy to use and works very well with the select boxes for restricted content directly on the relevant pages.

In short, doesn’t work

Sorry to take the time to leave a 1 star review but after trying for a solid 20 mins to get your plugin to restrict public access to pages, i just could not figure out how the hell to do it.
The instructions on the plugin setup page are cryptic, for example:

Select the Post Types that you wish to activate the Public Access meta box on.
(does this mean that the boxes i tick are restricted to public access, or the ones i do not tick are restricted to public access?)

Check the user roles that you do not wish to be available for selection via the Public Access metabox.
(same questions really – do the selected users get restricted or do they get to access the selected/not selected pages as chosen/not chosen above?)

Also, what is Public Access vs Admin Access if both selection lists contain roles requiring log in?

With a little clarity on what the checkboxes do (do they restrict or grant access when selected) this could be a super simple and easy to use plugin, until then though it’s a 1 star wonder.

It works, but…

The fourth plugin I’ve tried for restricting posts and the first that actually worked! A tad confusing (OK, I didn’t read the instructions, but still…) and it lacks an option to restrict by category (guess I’ll have to write my own), but it’s much simpler and nicer to work with than S2.

Fatal error

Parse error: syntax error, unexpected T_STRING, expecting T_CONSTANT_ENCAPSED_STRING or ‘(‘ in /var/www/vhosts/domain.com/subdomains/exams/httpdocs/wp-content/plugins/restrict-content-by-role/plugin.php on line 40

What I’m doing wrong?

Read all 11 reviews

Contributors & Developers

“Restrict Content by Role” is open source software. The following people have contributed to this plugin.

Contributors

Changelog

1.0.0

  • First stable release

1.1.0

  • Reviewed and refactored code

1.2.0

  • Updated for submission to WordPress plugin repository

2.0.0

  • The plugin can now restrict access to content on within wp-admin
  • You can now select which roles are shown in the custom meta box

2.1.0

  • Now works with the CMS Tree Page View plugin

3.0.0

  • Switched the way the meta box checkboxes work, so that they are more intuitive.

3.0.1

  • Fixed bug where new pages would be locked out.

3.1.0

  • New option to prevent users adding child pages to restricted pages.

3.1.1

  • Bug fix – sometimes new pages were automatically locked.

3.1.2

  • Bug fix – better fix for auto-locking pages.

3.2.0

  • Added checkbox to allow redirects back to the originally requested URL

3.3.0

  • Added ‘Public Access’ role, to restrict pages to logged in users
  • Fixed an issue that prevented Tree Page View from working with the plugin

3.3.1

  • Tested with WordPress 4.5, updated translations

3.4.0

  • Option to hide restricted pages from menu (only works when using wp_nav_menu())

3.4.1

  • Added missing Menu Access file

3.4.2

  • Allow admins to see backend menu items, even if they are restricted on the front end

3.5.0

  • Added ability to reset permissions for each role
  • Fixed menu when not hiding
  • Appended query string to redirect

3.5.1

  • Added new artwork

3.5.2

  • Bug fixes

3.5.3 – 3.5.6

  • Repair botched deploy