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.

Download for Free

Download
  1. Yves Nadeau

    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?

    • Pippin

      The pro version has short codes to do that, but not the free.

  2. Surya

    thanks Michael,

    I just downloaded it.

  3. Giovanni Floridia

    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 !

    • Pippin

      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?

    • Giovanni Floridia

      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!

    • Pippin

      Just to make sure, have you entered the messages in the correct places in the settings page?

    • Giovanni Floridia

      Yes, I have entered these messagens (You must be a Subscriber) in the settings area.

    • Pippin

      I will test all of the messages tomorrow and update as needed.

  4. rhys

    Hi, thanks for the plugin. Just wondering if its possible to se it for posts only, and have pages display as normal?

    • Pippin

      Each post / page is restricted manually, so yes, you can control it completely.

  5. Daniel

    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?

    • Pippin

      It is only possible if you modify the template files. By default, the plugin can only restrict the content.

  6. Daniel

    Ok, got it.

    Would one alternate way be to go with the Pro version and sort it out with subscriptions functionallity?

    • Pippin

      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.

  7. elrotciv

    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.

    • Pippin

      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.

  8. Rich

    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?

    • Pippin

      Do you have spaces between the short codes, or are the ][ right next to each other? Place a space in between them if so.

    • Rich

      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]

    • Pippin

      Oh I see why. I’ve just pushed out an update that should make it work.

  9. Rich

    Great to hear.

    Thank you for all the effort you’ve put into this plug-in.

  10. Ken Hodgson

    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.

    • Ken Hodgson

      It actually did allow more content – just wouldn’t allow me to paste it all at one into the box for some reason.

    • Pippin

      Let me know if you have any further questions 🙂

  11. David

    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

    • Pippin

      You will have to adjust that via CSS, probably from your theme’s style.css file.

  12. Marcio

    Hi there! is there any way to use this plugin along with the WPML(multi-language) ?

    • Pippin

      In what way? Do you to change the language of the restricted access message?

  13. Brian

    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!

    • Pippin

      This is a minor bug that I will be fixing tomorrow.

  14. Romain

    Hello,

    I did add this code [not_logged_in]blabla[/not_logged_in]
    But it doesn’t work.

    Could you help me ?
    Many thx!

  15. Romain

    Sorry I did add a reestriction on user type and a short code. It could not have worked 🙂 It works now 🙂

  16. Romain

    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!

    • Pippin

      Replace [logged_in_as_a_subscriber] with just [restrict]

  17. Romain

    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.

    🙂

    • Pippin

      Are you on the latest version of the plugin?

  18. mari

    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

    • Pippin

      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.

  19. Scot

    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!

    • Pippin

      Are you comfortable with a little PHP?

    • Scot

      Yes, but I haven’t looked into your plugin code yet.

    • Pippin

      Look at line 21 of includes/metabox.php

  20. kevin@websnextlevel.com

    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

    • Pippin

      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.

  21. rafael

    I need to hide a menu just for ordinary users, how can I do this?

    • Pippin

      Install the plugin called “Nav Menu Rles”.

  22. NS

    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.

    • Pippin

      This plugin doesn’t do anything with passwords.

  23. Harry

    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?

  24. Chris Grable

    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

    • Chris Grable

      Please note… I have only configured/restricted the “7th Annual Lower Shore Enterprises Basket Bingo” event…

    • Chris Grable

      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

    • Pippin

      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.

  25. Chris Grable

    Thanks Pippin! I’m gonna have to puzzle over this one for a while!

    Cheers,
    chris

  26. TAOST

    i can’t seem to figure out how to set up a login/register box. can you help?

    • Pippin

      Are you using the Pro (paid) version or the free one?

  27. TAOST

    the free one

    • Pippin

      The free version does not have login or registration forms. It simply allows you to restrict the content.

  28. TAOST

    You can restrict the content, but there is no way for users to register?

    • Pippin

      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.

  29. jasmine

    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.

    • Pippin

      Could you simply wrap the calendar short code in the [restrict] short code?

  30. Michael Klos

    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)

    • Pippin

      No, sorry.

Comments are closed.