I’m using Restrict Content By Role and User Role Editor (URE) plugin. Every time I create a new role using URE, Restrict Content By Role plugin restricts all page content to that role, including the homepage, resulting in no one being able to access my site. I have to go into each page individually and remove the restriction.
I’ve contacted the developers of URE with the same issue, not sure what plugin is causing it.
]]>Hi i use this Plugins more than 1 year and i love it much, but i saw there is no update for more than 1 year, is it safe to use this plugins, just worried using plugins which is not updated more than 1 year, possible to do update if any?
Thanks
KS
First of all, thanks so much for creating this plugin. It does what I need simply.
Our site has 175 Posts and 80 pages. When I enable Restrict Content By Role, the page count in the “At a Glance” widget on the dashboard and in the CMS Pages Tree widget now say 175 instead of 80. It seems that the plugin causes the post count to be used instead of the page count. Screenshot of the problem.
If you go to the “All Pages” screen, the correct count is shown. Screenshot
This is not a huge problem, but I thought you might be able to reproduce it easily and fix it in a future release.
Thanks again for your work on this plugin!
]]>Hi there,
I elected to Restrict Access to Content and Sub Content of 2 Event Manager pages
domain.com/events
domain.com/locations
The domain.com/locations will automatically change to domain.com/events/locations every time after I hit enter so it’s automatically restricted due to the restriction set on domain.com/events.
However, both pages have sub pages whenever a new event or new location is created.
The urls of those pages will be something like
domain.com/events/my-crazy-birthday-party
domain.com/locations/hard-rock-cafe-seattle
And these sub pages are not restricted even though I already set Restrict Access to Content and Sub Content of their parent pages.
Any solution to that, please?
Thank you and happy holidays:)
]]>I had to add a page to the admin part via
add_management_page( 'Vertr?ge anzeigen', 'Vertr?ge anzeigen', 'edit_posts', 'show_contracts', 'gr_show_contracts' );
This page should be accessible for editors. Unfortunately it is only visible for admin. If an editor tries to access that page, he get’s an error message “Cannot load show_contracts”.
Reason: Plugin Restrict Content by Role hardcodes allowed capabilities in line 43 of class module class.AdminAccess.php:
if( is_admin() && ! current_user_can( 'manage_options' ) ) { … }
Changing the capabilities above to “edit_post” solves the problem.
But: this should be done in the child theme and this does not work.
I tried the following in my functions.php:
function gr_admin_access() {
if (class_exists( 'mkdo\restrict_content_by_role\AdminAccess' )) {
get_template_part('gr-admin-access');
$gr_admin_access = new GR_AdminAccess;
}
}
add_action('init', 'gr_admin_access');
and in gr-admin-access.php:
<?php
use mkdo\restrict_content_by_role\AdminAccess;
class GR_AdminAccess extends AdminAccess {
public function run() {
remove_action( 'admin_init', array( '\mkdo\restrict_content_by_role\AdminAccess', 'get_excluded_posts' ) );
add_action( 'admin_init', array( $this, 'get_excluded_posts' ) );
}
/**
* Check if user has access
*/
public function get_excluded_posts() {
if( is_admin() && ! current_user_can( 'edit_posts' ) ) {
...
}
...
}
The new class is invoked, but I still get the error “Cannot load …” whereas if I change that line in the original class, it works.
What am I doing wrong? Any help would me very much appreciated.
]]>Hello,
Thanks for a great plugin, it has really helped me in my current project to restrict access to stuff based on what role the user has been assigned. However, I’ve found one issue.
Along with this plugin I am using a Role Creator/Editor plugin to create new/custom roles. I have tested two different plugins for this; Members and User Role Editor, and they both result in the same problem. Whenever I create a new role, no matter what plugin of the two I just named, the Restrict Content By Role plugin sets restricted access for some posts (not all, but some).
Does this plugin take inte account the creation of custom roles, and why do some posts get restricted access when I create a custom role? Is there some kind of default setting for this?
]]>Is it possible to do it the other way round? I have too many pages (products), and it seems i’ll have to modify each one to only allow a custom user role i’ve created. So, instead of restricting each one, could i just restrict the whole site except Home, About Us and Contact?
]]>I have two sites using this plugin and also running Yoast SEO. After an update was applied bringing Yoast SEO up to the current version (5.5.1), pages on both sites that had been set to Public Access ended up with 2 (new?) user roles (SEO Manager and SEO Editor) checked off as restricted. Public Access to those pages was also restricted even though the box was not checked off for that (i.e., you had to log in to see the home page).
I had to manually edit the affected pages and uncheck the boxes to unrestrict those roles, after which Public Access worked again. I don’t know if this is an issue related specifically to Yoast, or if the same thing would happen if any other plugin added new user roles after this plugin did its thing.
I am not sure at the moment if I am running this on other sites where the Yoast update has not yet been applied. Is there a way to prevent this from happening there, or zap the database to remove restrictions for new user roles, if those got created somehow?
Thanks,
Barry
]]>Hello,
the restriction works fine, but when I search for a post in the frontend, the restricted post apears in the search results. Is it a bug in the plugin or in my theme?
Thanks,
Steven
Hi,
While this plugin is working very well for keeping select users from viewing certain content, it’s preventing public users from viewing a page that’s not protected. If I’m logged in, I can see the desired page, but not when logged out. I’ve gone over the Setting’s page thoroughly for this plugin, but nothing seems to work. I’ve tried changing the parent page, url, etc., to to avail. Any ideas?
Thanks.
]]>Your plugin says.. Tested up to: 4.5.9
Is the plugin not developed and supported anymore? Or will this tested up to version be updated soon?
Thanks
]]>Hi!
I’m trying to use the plugin but I’m not having success.
I just install the plugin with admin user and after that I tried to login with another user. However, after the login with the another user, it appears a blank page. (with admin user keep working)
I would like to allow access to specific pages based on user roles. I tried many to assign many roles in a specific pages but it wasnt work either. Always appers a blank page to users that aren’t admin.
Could you please help me how to do that?
Tanks.
]]>Hi,
I am admin and logged in but when I want to “view page” (from the WP dashboard) on a page that I restricted for public acces in the meta box on the page, I cannot see the page and I am redirected to the login screen.
Is this a bug or what should I do so that I (and other logged in visitors) can see the page?
]]>Hi,
Awesome plugin. Thanks for taking the time to make it.
Unfortunately the logic is backwards for my use-case. This may be an easy fix for you to add someday…
Basically we’re using WP for website style guides for clients > client gets a user role (different plugin) > all clients staff gets this role (several users) > we apply this via post edit > all great! But: when we add a new role for a different client, we’re forced to revisit all old content to ensure this new role can’t see another clients work. In other words, you should add an option to reverse the logic on the post edit screen so that future roles can’t see this. Make sense? Let me know if you need further clarification.
– Joseph
]]>Hi,
Can restrictions be applied based on custom post date?
User role #1 sees ALL published/updated custom posts as soon as they are published/updated.
User role #2 only sees custom posts that were published/updated x number of days ago or older.
If this is possible how can I implement it. Thank you so much!!!
Hi There
I have the plugin setup and restricting users by role for Sensei courses. This works well and if someone tries to access content, they redirect to a custom page explaining content is restricted and what to do to access.
HOWEVER, i am also using Theme-My-Login for users to login and register (as subscribers). When i click the “register” button from the Theme-My-Login page it redirects to the custom page mentioned above for Sensei courses.
There is no restrictions set on pages at all (just courses). I wondered if it was another plugin, but the problem doesn’t occur when your plugin is deactivated.
Any reason why this might be happening? Under settings it does reference “Enter the full URL that you wish to redirect to. (Leave blank to redirect to login screen)”. Seems to be overriding content/pages with my custom redirect even when there is no restriction in place for those pages. Seems the plugin is ignoring rules, and redirecting for everyone.
Any suggestions would be great.
Thanks
]]>Hi there,
I’m experiencing an issue with the plugin where roles that have not been set to “restricted” are nonetheless getting redirected.
My scenario is to restrict access to courses & lessons (Sensei) so these are checked in the settings and on the Course and lessons pages content is restricted for the roles of ‘subscriber’, ‘customer’, ‘public access’ only.
It seems to work fine for Courses, but when i click the link from a course to an associated lesson i get redirected (as an Admin).
I’m using a custom redirect as this is restricting users of a role, not those who have not logged in (i’m guessing that shouldn’t make a difference).
Welcome your thoughts.
Cheers, Matt
]]>Hello
I have set a page “restricted content” to inform people that some page are restricted to registered users.
This page shows a message “This page is restricted to registered users” with a login form.
I have also registered user with a custom role ‘vip”.
For some page, I have restricted page for “vip” role.
When user is registered but his role is “subscriber” he will not see the content but the message on the restricted content page is not OK since user is registered but he can’t see the page. SO I was was wondering how to customize message on the “restricted content” page?
Any idea would be really appreciated.
Hi,
Thanks for making this plugin. I installed it and I’m having the issue that subcontent is not being restricted. The parent page redirects to the login form but subpages still show their content, even though I have selected “Restrict Access to Content and Sub Content” on the parent page.
Any ideas?
Thanks!
Tobias
Hello,
is there also a way to restrict specific roles to create pages?
I allow auhtor role to see a specific page but this role shouldn’t be able to create new page..
Is this possible or do I need another plugin in addition?
Thanks for the help in advance!
]]>HI,
I am using restrict content by role since a few months. The plugin was working perfect. But now when I am creating a new site and select some role to restrict, cannot login to this new page even as admin. Also if I change the settings in a still existing page the same happens there.
I don’t know if it’s because I am running the plugin “My Private Site” parallel.
Maybe you have some idea to solve this problem.
Regards from Austria
Chris
I am having troubles with users signing up and accessing the website even thought they are still PENDING! Will this fix my problem?
]]>Hello
In the note you state you are making a new plugin to replace this, is it best to install the new one instead of the existing one?
I would be wasting my time if I set this up only for it to be replaced shortly..
Hello,
Great work!
I use role editor to duplicate an role, and renamed the new role, but it does not show up at setting page, would you please let me know:
1# multi site support?
2# support custom role type?
Thanks, have a nice day!
Alex
]]>Hello,
I have installed your Restrict Content By Role plugin, however it is not redirecting as expected. My steps were:
I got this error when trying to save a post with role restrictions:
Fatal error: Call to undefined function boolval() in /…/wp-content/plugins/role-content-restriction/class-role-content-restriction.php on line 157
]]>Love the plugin but is there an option to apply restrictions in bulk? I’ve got several hundred items that I would like to apply content restrictions to. Any options short of editing each and every one?
]]>If I’m not mistaken, this plugin fetches all posts from the DB on every admin request. Obviously, this is very bad.
Here’s the offending line: https://github.com/mkdo/restrict-content-by-role/blob/master/php/class.AdminAccess.php#L79
]]>
if( $object !== NULL && 'nav_menu_item' !== $object->post_type ) {
$old_parent = $post !== NULL ? $post->post_parent : NULL;
Check if object exists before accessing the object ??
]]>Hello!
After installing your plugin and restricting back-end access for several pages to specific roles, when signing in using an editor account that has one of the roles with restrictions applied to it, WordPress displays a 500 internal server error and will not load the Dashboard.
When signing in with an administrator account, the Dashboard still loads. After disabling your plugin, the restricted account is able to view the Dashboard and navigate through the back-end as usual (except once the plugin is disabled, the restrictions don’t work).
Any suggestions on things to try in order to get things working as expected?
Thanks for your help!
]]>