Page Restrict WordPress Plugin
Restrict certain pages to logged in users
This plugin will allow you to restrict all, none, or certain pages to logged in users only.
In some cases where you are using WordPress as a CMS and only want logged in users to have access to the content or where you want users to register for purposes unknown so that they can see the content, then this plugin is what you are looking for.
Simple admin interface to select all, none, or some of your pages. This does not work for posts, only pages.
Screenshots
- Login Form
- Admin Page
Installation
- Upload the `pagerestrict` folder to the `/wp-content/plugins/` directory
- Activate the plugin through the ‘Plugins’ menu in WordPress
Upgrade
- Deactivate the plugin through the ‘Plugins’ menu in WordPress
- Delete the previous `pagerestrict` folder from the `/wp-content/plugins/` directory
- Upload the new `pagerestrict` folder to the `/wp-content/plugins/` directory
- Activate the plugin through the ‘Plugins’ menu in WordPress
Usage
- Visit Settings>Page Restrict in the admin area of your blog.
- Select your restriction method (all, none, selected).
- If you chose selected, select the pages you wish to restrict.
- Enjoy.
1.5 (2008-09-03):
- Added ability to change restriction method
- Rewrote and simplified areas pertaining to the list of pages
1.4.1 (2008-08-25):
- Added back no_cache add_action that was lost in the admin separation
- Removed duplicate add_action for the admin page
1.4 (2008-08-25):
- Updated version number scheme
- Updated code for readability
- Moved admin functionality to serperate file included only when is_admin is true
0.3.1 (2008-08-16):
- Updated for PHP4 Support
- Restored missing PHP tag
0.3 (2008-08-14):
- Initial Public Release
Download
Page Restrict version 1.5
Archived Versions
Possibly Related Posts:
- Add a Class to Parent Categories Using wp_list_categories in WordPress
- Adding a Link to the WordPress 2.7 Favorites Dropdown
- Better Howdy WordPress Plugin
- Separating Pings from Comments in WordPress 2.7
- Changes Coming for Shadowbox JS
Comments
Comment from Matt
Time August 15, 2008 at 12:52 pm
@Toby: This plugin hooks into the_content. In page.php of your theme you should have something similar to <?php the_content('<p class="serif">Read the rest of this page »</p>'); ?>
As long as this is used to display the page content then this plugin should work. See http://codex.wordpress.org/Template_Tags/the_content for more information about the_content.
Comment from Tom Usher
Time August 16, 2008 at 3:51 pm
Hello Matt,
I loaded Page Restrict 0.3 and activated it. Everything seemed fine. However, the next day, I attempted to visit my site’s index page (WordPress 2.6.1 http://www.realliberalchristianchurch.org/wordpress) while not logged in. I received the following error:
Fatal error: Call to undefined function: date_default_timezone_get() in [...]/html/wordpress/wp-content/plugins/pagerestrict/pagerestrict.php on line 59
By trying different combinations of being logged in and not with the plugin activated and not and by clearing my blog cache each time, I discovered that my site was blocked to everyone not a logged-in user. It’s a little unsettling to realize that all the Friday and Saturday traffic to the site has been lost, but that’s how it goes. I’m just glad I caught it as soon as I did.
I had not changed the default setting in the plugin. No pages were selected. I had simply downloaded and activated in anticipation of users with whom I will want to share inside information.
The plugin’s concept is good. The settings interface looks clean and well organized. I won’t to use your plugin. I’d like to see different settings for each page depending upon the WordPress role of the user too.
I hope this information helps you. If you’d like me to test a patched version, I’m willing. Just email me, and I’ll get back to this.
Thanks,
Tom Usher
Comment from Matt
Time August 16, 2008 at 4:43 pm
@Tom Usher: I had not intended on making the plugin PHP4 compatible since PHP4 is now end of life. However, the fix to make this plugin PHP4 compatible made me clean up some code. With that being said, the plugin should now work with PHP4. I have published the fixes and they can be downloaded from the WordPress plugins site or from the links above.
Comment from Tom Usher
Time August 16, 2008 at 5:46 pm
That was quick! Thanks!
I tried to get my server to handle PHP5 and to actually handle both, but I’m on GoDaddy, and it won’t accept the patch. Yours is the second plugin that I’ve run into where PHP5 would have been better to be using.
I’ve forgotten what it was I did in attempting to get both 4 and 5 to work depending, but I’m sure I can find it again. I should probably make a request to GoDaddy to make it possible. I don’t know what their security concerns are with it.
By the way, since I brought them up, GoDaddy has much bad press out there. I really haven’t found them to be difficult to work with or unresponsive, etc. Every problem I’ve had has been clean up fairly quickly and politely so, I might add. In fact, I really like it that they seem to be free-political-speech oriented. I digress. Thanks again. If you don’t hear from me, the update worked. I’m sure it will.
God bless.
Comment from Toby
Time August 16, 2008 at 8:45 pm
Thanks Matt! That is exactly the info I needed. I am using “the_excerpt()” on the page in question. :)
Comment from Matt
Time August 16, 2008 at 8:52 pm
@Toby: I hadn’t anticipated there being the possibility of using the_excerpt on a page. Perhaps it would be a good idea for me to add the_excerpt to the plugin as well.
Trackbacks/Pingbacks
- 8 WordPress Plugins for Page Management - Mashable
- Sudeep Mandal » Making Wordpress pages visible only after login
- Nowog.com » 8款WordPress页面管理插件
- 8 WordPress Plugins for Page Management « LocalLab : Foire aux Infos


Comment from Toby
Time August 15, 2008 at 12:46 pm
Hello!
I am using WP 2.6 with a custom theme, and the plug-in doesn’t seem to have any effect. When I switch over to the “Copyblogger” theme, the plugin works great. Is there a WP function call that is required for this plugin to work (perhaps one that I left out of my custom theme)?
Here is the url that is currently set to require login with your plugin: http://www.themightymo.com/testblog3/members/
Thanks!