Post Last Updated: 1/30/2007
Recently, I installed Chad Butler’s WP-Members Plugin. I love this plugin, because I can keep my members of my blog separate from the wordpress users and the whole level nonsense. I did not want any of my members to have access to the inner workings of wordpress, I just wanted my readers to have access to my private content. Additionally, I didn’t want to have to make all my posts private, I wanted my pages private and some content in my posts private. I didn’t have an easy option using WP-Members alone. I didn’t want to have to add PHP code to every post I wanted to make private.
I saw Alan Who’s ProtectContent Plugin and I really liked it, but it really didn’t apply to the WP-Members functionality. So, I combined the two and Viola! I have a brand new plugin.
That being said. If you have not installed the WP-Members plugin, DO NOT install this plugin, go to Alan Who’s site and download the original ProtectContent Plugin because that is what you need for your purposes. However, if you are in the same situation I was in, please download and let me know what you think. I will try to keep up on updating this plugin as needed, but I don’t have a whole lot of time, so the updates may be slow in coming, unless they are generally easy fixes.
Description:
Protects sections of content from users who are not logged in using <!--protectcontent--> and <!--/protectcontent--> in between the protected content. This plugin was altered to be used with Chad Butler’s WP-Members Plugin instead of the original user levels that WP provides.
Version: 0.1
Compatability: WP 2.0.4+, WP 2.1 (Hasn’t been tested on anything less than WP 2.0.4, you are welcome to try it on a WP version lower than 2.0, but don’t blame me if it doesn’t work. However, if you find that it does work for you on a lower version of WP, let me know in the comment section, so I can update this. Also, Chad Butler’s WP Members is compatible with WP 2.1.)
Author: Astrocoz…You would see my real name after my screen name if you were logged in, because I am using the plugin on this post.
Download: Here
STEPS:
- Download the plugin
- Change the link below to point to where you have your members register for your blog. Scroll down to do this line and replace the url with the url to your registration page.
echo "Only registered users may view this. <a href='http://www.yourRegistrationPage.com'>Register now</a>. Its free.\n"; - Upload protectcontent.php to your /wp-content/plugins directory
- Activate in the Admin Plugin panel
- Wrap content to be hidden with the tags
<!--protectcontent-->and<--/protectcontent-->
Example of a post:
Test post.
<!--protectcontent-->
A secret. You are clearly logged in.
<!--/protectcontent-->
Here endith this post.

November 12th, 2006 at 4:39 am
This is why you are an engineer….it made me tired to read all that!
LOL!
November 12th, 2006 at 6:46 am
Hey,
Like the idea of your work on the plugin. I tried it out by visiting your pictures page and then registered and logged in. I see two issues. when I click on a link and I am not logged in and the content is ‘protected’, and I thus register and login, it would be nice to redirected to the page a previously tried to view. Agree? Also I am now logged in now, but I want to look at my account data, name, location, email again. Can this other plugin provide such an area?
Alan Who.
Those would be great features to add to this plugin. I have often times come across these same issues, so its in the works! Thanks for stopping by and trying it out! I really dug your ProtectContent plugin!
November 12th, 2006 at 2:57 pm
No problemo. I think we are onto something here … Maybe me, you and Chad Butler could combine our plugins into something that protects content from users not logged in? There is one plugin called “subscribers-only” that the author has refused to release to the public, it has created a lot of interest and frustration because lots of bloggers want a way to force users to register and log in to view certain areas of their blog. I am going to be working on this during my spare time over the next few weeks, but if we work on it together then it will be better and 3 is better than 1. Email me if your interested.
Alan.
I think I might give it a shot. I’m good at figuring stuff out and integration…so, I’m going to consider it.
November 16th, 2006 at 4:51 pm
Is there any type of email confirmation so that people cannot get access unless they use real email addresses?
November 17th, 2006 at 10:12 am
Does anyone know the name of the wordpress plugin that creates a list of your posts in a category instead of just displaying them one after the other? I want it so that when someone clicks on a category they just get a list of posts from that category.
I'm sure Ive seen one…and sifting through the WP site is a nightmare
November 27th, 2006 at 8:08 am
Brent, go to theme-editor in wordpress, edit category or archive template.. or even the main index page. there you will see a code like “while_have_posts”, then follows php command “the_title()” which displays the permalink, then follows the content writing php section. you just cut out that section and it will not show.
December 12th, 2006 at 2:10 pm
What I want to do on my blog, is every few hours take the oldest post and move it to the
front of the queue, all automatically. Anyone know if there is a plugin that can do this or
a simple way to set up another plugin to do this (use my own feed perhaps)?
Thanks.
January 25th, 2007 at 8:42 am
It’s a hack I know, but I put my private posts in a subcategory of ‘members’ and then use get_category_parents($cat) in my category template to test for ‘members’ and trigger ’securify’. Then I don’t need to tags posts at all.
But I need help to figure out how to make the password reminder to work with Permalinks active. Any suggestions?
First of all, I think that is a great idea for a hack! If I had thought of it myself that is definitely something I would have tried. But mostly for my purposes, I just want some of the content in my posts private…not necessarily the entire post. But if I find that I want entire posts private, I will have to try that hack out!
I encountered the same problem with permalinks if I used anything but the default permalinks. I think this is a bug for Chad Butler’s WP-Members Plugin. In order to solve this problem temporarily, if someone clicks the password reminder link, it sends me an email with the proper information requesting their password.
I haven’t tried to fix the bug myself yet, but I am almost sure it has something to do with the wp-members.php file. I hope that helps you a bit. If I ever do find a solution to fix the bug, I’ll email you the solution.
January 25th, 2007 at 12:51 pm
Thanks for the speedy feedback. If I stumble across a fix to the permalinks thing I’ll let you know. If you know how to contat Chad, could you pass on the problem?
I’m not sure on how to contact him…however, I am working on it and once I get in contact with him, I’ll let him know.
February 13th, 2007 at 11:45 am
Having a problem. I’ve tried several themes and am having the same problem with all
Warning: Cannot modify header information - headers already sent by (output started at /home/buythath/public_html/wp-content/themes/digg-3-columns-10/header.php:5) in /home/buythath/public_html/wp-content/plugins/wp-members.php on line 154
Warning: Cannot modify header information - headers already sent by (output started at /home/buythath/public_html/wp-content/themes/digg-3-columns-10/header.php:5) in /home/buythath/public_html/wp-content/plugins/wp-members.php on line 155
I’m getting this after login?
Is there something I am doing wrong?
I’m not really sure what this problem is exactly. My theme was modified from the default Kubric theme. However, all themes being different, some things should be the same.
Make sure that this line:
< ?php if (function_exists('wpmem')) { $securify = wpmem(); }?>
is before this line:
< ?php get_header(); ?>
Then for any complete page you want blocked using wp-members, stick this:
< ?php
// begin wpmem plugin
if ( ($securify != "false") || (!function_exists('wpmem')) ) {
if (function_exists('wpmem')) { wpmem_status($securify);}
if ( ($securify == "true") || (!function_exists('wpmem')) ) {
?>
Before the loop to get posts, which is this:
< ?php if (have_posts()) : ?>
Then End with this:
< ?php
}
}
?>
Which will go before you call the sidebar and footer.
My plugin plays directly off calling wp-member.php functions…So, if you are having trouble with my plugin, I would suggest deactivating it and seeing if things go back to normal after you login. If the problem still remains, and you have followed everything on Chad Butler’s page, then the problem is with the wp-member plugin and I would contact him. If its a problem with my plugin, email me your theme so I can see what is going on. Its hard to tell with the error messages. I think the problem has to do with where you are putting the call for wp-member functions on your theme files, but it could be something different.
February 24th, 2007 at 7:44 am
I have the subscriber-only plugin can u make it better. I can email it to you.
July 19th, 2007 at 10:49 pm
[...] Visit [...]
September 8th, 2007 at 1:36 am
[...] Visit [...]
September 13th, 2007 at 7:43 am
******* This plugin is in the process of being updated! *******
The new version 0.2 (Compatible with WP-Members 2.0.b) will be available for download on this page in a couple of days. In addition, there will be some documentation on the WP-Members plugin to fill in some of the blanks about how to not make all your posts private, how to make certain pages private, etc. If you like the way this blog is set up for WP-Members, this will be a good guide on how to replicate what I’ve done with this site.