This plugin will very easily let you restrict content on your WordPress site to registered users. It permits you to restrict entire posts / pages or individual sections of content within a post or page.
Features
- Restrict entire posts / pages.
- Restrict sections of content.
- Unlimited number of restricted areas.
- Works with all Custom Post Types
- Five restriction levels – uses WordPress’s regular user levels.
- Hide content displayed in WordPress feeds.
Usage
First upload to wp-content/plugins and click activate from the WordPress plugins menu.
To restrict an entire post or page, simply select the user level you’d like to restrict the post or page to from the drop down menu added just below the post/page editor.
To restrict just a section of content within a post or page, you may use shortcodes like this:
[restrict userlevel="editor"] . . . your restricted content goes here . . . [/restrict] |
Accepted userlevel values are:
- admin
- editor
- author
- subscriber
- contributor
There is also a short code that can be used for showing content to users that are not logged in:
[not_logged_in]This is only shown to non-logged-in users[/not_logged_in] |
A premium version of this plugin can be found here.
Im currently using your plugin and i love it, i was wondering if there is a way to kinda reverse the restriction level… Example for a non registrer user, you would see : Please registrer…. But for the registered user, i would like to actually hide this phrase? does your plugin do that?
The pro version has short codes to do that, but not the free.
thanks Michael,
I just downloaded it.
Hi Pippin,
thank you for this plugin, it is very nice and fits very well in a lot of needs, as I just read.
It seems to me there is a strange behaviour in the responses of autheticated roles.
I tried a lot of combinations switching a post permission and the role. In my tables bellow I put the role I play (I am) vs. the permissions of the post (I must be). The output is:
– ok: access allowed;
– BS: You must Become Subscriber;
– BC: You must Become Contributor;
– BA: Become Author;
and so on. Suppose these are the messages of config file for each role.
The table sumarizes the returns:
I Must Be: Visitor Subscriber Contributor Author Editor
I am:
Visitor ok BS BC BA BE
Subscriber ok ok BS BS BS
Contributor ok ok ok BC BC
Author ok ok ok ok BA
It should return (IMHO)
I Must Be: Visitor Subscriber Contributor Author Editor
I am:
Visitor ok BS BC BA BE
Subscriber ok ok BC BA BE
Contributor ok ok ok BA BE
Author ok ok ok ok BE
The behavior for a unauthenticated Visitor is Ok. If I am a Subscriber, for instance, and try to access a Contributor Post, I get BS (Become a Subscriber) instead of BC (You must Become a Contributor).
What am I missing ?
Thanks !
Just to make sure I understand how you have it set up: are you saying that you have a post restricted to Contributors, but it is displaying the message for “You need to be a subscriber” when a non-contributor is viewing the post?
Hi,
To non registered user, it is ok.
To a subscriber, it returns “You must be a Subscriber” if the content is Contributor or above.
to a Contributor it retirns “You must be a Contributor” if The content is Author or above…
And so on…
Thanks!
Just to make sure, have you entered the messages in the correct places in the settings page?
Yes, I have entered these messagens (You must be a Subscriber) in the settings area.
I will test all of the messages tomorrow and update as needed.
Hi, thanks for the plugin. Just wondering if its possible to se it for posts only, and have pages display as normal?
Each post / page is restricted manually, so yes, you can control it completely.
Ops, accident posted in the pro-section earlier.
A quick question about the The “hide from feed” checkoption. When checked the post title and featured image is still visible to unauthorized yours. Is this intended or it there a way to totally hide a blogpost?
It is only possible if you modify the template files. By default, the plugin can only restrict the content.
Ok, got it.
Would one alternate way be to go with the Pro version and sort it out with subscriptions functionallity?
Same scenario, you would have to modify the template files. The pro version does give you additional template tags you can use, but it will not hide those items automatically.
Hi Pippin, I’ve just discovered your app and think it’s great. Thanks so much for publishing a free version for us hobbyist, bloggers and npo’s out there.
As I’m coming to the game late, I already have several hundred posts on my site and wanted to know if there was a way to quickly apply a restriction to these in one go.
I’m glad you like it! The only way to apply restriction in bulk is to create a custom function that makes the updates for you.
The plug-in is exactly what I’ve been looking for, wanting to inform visitors of the need to subscribe in order to take an action. Am experiencing a, hopefully, small issue. I’m trying to place a shortcode within the ‘not logged in’ shortcode. When doing so, it will display the text of the shortcode and not take any action on it.
Any advice?
Do you have spaces between the short codes, or are the ][ right next to each other? Place a space in between them if so.
There were spaced between the shortcodes. There were actually a combination of words and spaces.
[not_logged_in]You must [jbutton size="small" color="green" rounded="yes" link="http://msi.icweekly.net/wp-login.php?action=register"]Register[/jbutton] in order to submit a song[/not_logged_in]
Oh I see why. I’ve just pushed out an update that should make it work.
Great to hear.
Thank you for all the effort you’ve put into this plug-in.
Great plug in! I wish my content wasn’t limited to so few charecters on the settings page. I was trying to add some HTML and you can’t add too many charecters.
It actually did allow more content – just wouldn’t allow me to paste it all at one into the box for some reason.
Let me know if you have any further questions 🙂
Great plugin!! Thank you very much for providing this, it really helps those of us who don’t know what we’re doing.
Is there a way to increase the font size of the display message?
Thanks
You will have to adjust that via CSS, probably from your theme’s style.css file.
Hi there! is there any way to use this plugin along with the WPML(multi-language) ?
In what way? Do you to change the language of the restricted access message?
I was trying to add a link in the message box of your plugin and every time I press “save” the html gets cut off after <a href= . Is there any way to allow a link in the text box? Thank you!
This is a minor bug that I will be fixing tomorrow.
Hello,
I did add this code [not_logged_in]blabla[/not_logged_in]
But it doesn’t work.
Could you help me ?
Many thx!
Sorry I did add a reestriction on user type and a short code. It could not have worked 🙂 It works now 🙂
Hum actually no 🙁 .
How can I do this :
[not_logged_in]Please connect[/not_logged_in]
[logged_in_as_a_subscriber]Here it is dear subscriber[logged_in_as_a_subscriber]
When I specify the page only readable by the subscriber, the subscriber cannot read the “Please connect” message.
Thanks for your help!
Replace [logged_in_as_a_subscriber] with just [restrict]
Hello Pippin, thanks for your help.
Actually I think that it is the [not_logged_in] shortcode which is my problem.
When I am not logged in, I cannot see the message between shortcodes.
[not_logged_in] Please connect [/not_logged_in]
The strage point is that I also don’t see this message when I am logged in.
🙂
Are you on the latest version of the plugin?
HI, I just discovered your plugin after watching a lesson on Lynda.com and now I’m very interested in using it on a new site. My question is this: how is this different from simply password protecting pages in WordPress? Is this a safer method? If so, how? Just trying to understand all of this. Thanks in advance for your time. mari
With this plugin you can give users individual user accounts. When you password protect a page, all users will use the same password to access the page.
I added a new role (“website-members”) using the Members plugin and would like to include that in the list of “Accepted userlevel values”. How can I make the new role appear in the “Restrict this content” metabox in the page editor? Can I hook into your plugin to add it or can you make that available in the next update?
Cheers!
Are you comfortable with a little PHP?
Yes, but I haven’t looked into your plugin code yet.
Look at line 21 of includes/metabox.php
Hi,
We’re evaluating “Restricted Content Plugin – Free”. Our WordPress setup involves creating templates we create from scratch and only accessing shortcodes through PHP function, for example:
Couple questions:
1) In using this plugin, the approach was to put the function at the top of the .php page. I’ve tried both [restrict ...] and [restrict]. But this doesn’t seem to restrict content when I select for Administrators only. Access from a different browser/sessions while not authenticated the page is fully viewable.
2) For this option:
Hide the excerpt of this post / page from the Feed?
Is that supposed to stop the page from being listed when using this function:
That would be something we need,
Any help would sure be appreciated. We really want to use your plugin for a custom template implementation of WordPress.
Thanks,
Kevin
1. Can you show me how you are setting up the function?
2. Yes, that will prevent the page content from being shown in feeds.
I need to hide a menu just for ordinary users, how can I do this?
Install the plugin called “Nav Menu Rles”.
Can your “Restrict Contect” plugin be used to hide menu/sub menus/sub sub menus with same password? In other words does it support mulitple pages password protection or it work page by page?
Please reply soon as I have a need to password protect a menu and it’s sub menus under password. It’s a marketing website and I am building it on “Pitch” WordPress theme.
This plugin doesn’t do anything with passwords.
I am a newbie to wordpress. I bought the plugin and can’t find how to customize the register/login input fields for width to make the look and feel a little cleaner.
Can you point me to what I need to do?
You have commented on the free version of the plugin, not the pro version which you purchased. Please open a support ticket on the forums and I will be happy to help you out: http://support.pippinsplugins.com/forums/forum/restrict-content-pro/
This is a test site… I installed and setup the plugin but I not seeing it restrict access… Was wondering if you might have a suggestion…
Thanks!
chris
Please note… I have only configured/restricted the “7th Annual Lower Shore Enterprises Basket Bingo” event…
Okay… one last note. I just noticed that the text… indicating the lack of appropriate access IS presented on the page. The problem is that all of the other info on the page is also displayed. I’m sure this is because this data is from an event management script that is integral to the theme. Unless you can think of a novel workaround… I’ll ping them for a solution.
Cheers,
chris
Chris, this plugin will only be able to restrict whatever you have placed into the main content area of the page. It sounds like the rest of the info you were hoping would be restricted is outside of that.
Thanks Pippin! I’m gonna have to puzzle over this one for a while!
Cheers,
chris
i can’t seem to figure out how to set up a login/register box. can you help?
Are you using the Pro (paid) version or the free one?
the free one
The free version does not have login or registration forms. It simply allows you to restrict the content.
You can restrict the content, but there is no way for users to register?
WordPress provides default ways for users to register / login. Go to Settings > General and check the box for “Anyone can register”, then you can go to yoursite.com/wp-login.php. There will be a register link there.
Hi,
I want to restrict the events page to logged in users only. The events page has an event calendar plugin on it, if that makes any difference.
Could you simply wrap the calendar short code in the [restrict] short code?
Is there any way to utilize custom roles? From what i can see in the code, this plugin appears to be based on role capabilities instead of role name, so defining another read-only role (e.g. “SubscribersTwo”) and attempting to restrict based on that new role doesn’t appear to work. For example…
[restrict userlevel="SubscribersTwo"] Awesome SubscribersTwo-only Content [/restrict]
(I didn’t see this functionality in the paid version of the RC plugin either; please correct me if i’m mistaken)
No, sorry.