When WP-Members was first offered, the primary use of the plugin was to protect content in posts. WordPress itself was primarily used as a blogging platform where most content was actually in posts as well. With the continued development of the WP platform and the widespread use of it as a lightweight CMS, that has evolved to situations where users are using it more as a CMS and managing pages more than posts. (If you don’t really understand the difference, there is an overview at WordPress.com.)
WP-Members has provided blocking for both posts and pages since the very early versions. But it seems lately I have been receiving a lot of support questions regarding the blocking of pages.
The default installation for the plugin is to use post excerpts above the ‘more’ tag if the user is not logged in. This is true of both posts and pages. You can turn this feature off in the plugin’s settings by unchecking “show excerpts.” Turning this off will not effect the use of the ‘more’ tag for post summary pages. It only serves to turn off excerpts on the actual post or page if the user is not logged in. If the user is not logged in, they will be provided with a message indicating that the content is restricted, the login form, and the registration form. If excerpts are turned on, then all content before the ‘more’ tag will be presented before this.
Some important things to consider:
- First, if excerpts are turned on (“show excerpts” in the plugin admin panel), you MUST use the ‘more’ tag on any protected pages. If you don’t, all of your page content will be visible before the login form. If you don’t want your pages to function this way, you need to turn off “show excerpts.”
- If you use the ‘more’ tag on a page, you cannot have any use of the word “more” in the excerpt. If you use the “more” in your excerpt, the parser will truncate your excerpt there rather than at the actual ‘more’ tag.
- You cannot have any shortcodes in the excerpt. I am working on this for future upgrades, but at this point, if you use a shortcode in the excerpt (including WP-Members own new shortcodes), they will not be parsed and executed.
The default install for the plugin is to not block pages by default. If you leave this setting, you can block any individual page by using a custom field “block” and setting the value to “true”. Important: this is case sensitive! Do not put this in as “Block” or it will not work.
If you have changed the default setting to block pages by default, you can unblock pages by using a custom field of “unblock” with a value of “true”. (Note: also case sensitive.)
If you are using either of the above two custom fields and you have left the plugin’s setting to show excerpts, you MUST use the ‘more’ tag on the blocked pages. If you don’t want to do that, turn off the show excerpts setting.
Troubleshooting
If you have just installed the plugin and find that your protected pages are showing content before the login that should not be there, check to see if you have the default setting of “show excerpts” in the plugin’s admin panel. If you do, you either need to turn this off, or use a ‘more’ tag where you want the excerpt.
If you are using a custom field to block or unblock a page and you are not getting the expected behavior, double check that you have not inadvertently capitalized the custom field (i.e. “Block” or “Unblock”). If you have, you are going to need to remove this from the database manually.

Hi,
First let me say thank you for this great plugin! I was wondering if you could tell me how to remove the login box that appears on a post or page when the content is hidden. I am using another login control plugin which places a login box on the sidebar, and I simply want to use the WP Membership plugin to hide content from non-registered users, and direct them to login on the sidebar.
I would greatly appreciate your help in this matter.
Thank you again!
Thanks Lauren for your comment! Let me start by saying that I never recommend making changes to the code as that means you need to recreate your changes in the event of an upgrade of the plugin. With that caveat, what you need to change is in the wp-members-core.php file. The function wpmem_securify function is where all of the possibilities of how/what to display are handled. The function that calls the login box is wpmem_inc_login, so that needs to be disabled from the conditions that you want to remove it from. I would comment that out ( //wpmem_inc_login). Hope that helps!
How can I make this work with affiliate pro plus , wp-members is not allowing affiliate refferal id’s or the tracking HELPPPPPPPPPPPPPP please
Hi Derek – I’m not familiar with that particular plugin, but my guess is that it captures referral info as hidden fields – you’d have to look for sure. That would need to be added to the registration process – not a small task, but not impossible depending on how handy with php you are.
Hi Chad
Your Reply”I’m not familiar with that particular plugin, but my guess is that it captures referral info as hidden fields – you’d have to look for sure. That would need to be added to the registration process – not a small task, but not impossible depending on how handy with php you are.”
The Plugin in question allocates to the standard registration page refferal id and select a user name as does yours the only difference is therefore the following of ref id and the overwritten cookie facility and in the user data base it shows how many refs made and on the new sign up who referred the new sign up.
as far as php is concerned I am more fluent in double dutch and Esperanto i.e no clue what so ever.
thank you for your reply on this.
Regards
Derek
Hi there!
I’m new in the WP-world and I need the WP-Members plugin. I installed the plugin, but now I don’t know how to protect certain pages so that only members can access them with their password. I’m working in wysiwyg and i can not find the custom fields everyone’s talking about on the forum. I’m sorry to bother you with my question, but as I said it is my first website.
Thank you!
Kind regards
Hi Mirte – you’ll find custom fields just below the wysiwyg editor. However, in WP 3.1, these are now turned off (from the display, not from functioning) by default and need to be turned on. Look to the upper right hand corner of the admin for “screen options” when you are on the page/post editing page. This is where you turn on the custom fields.
Hi,
Is there anyway to make membership contingent on paying a fee through paypal or the like?
Thanks.
I actually have a PayPal add-on in development. Not sure when that will be ready for release, though.
However, in the meantime you could moderate registrations manually and have a manual payment system. Depending on how many users you have would determine whether this is feasible.
Hi there!
I have a question regarding the registration fields. Is there any way of having custom fields? As in changing the default Name, Email, Address, etc to require different things like School or Company?
Thanks
Adding custom fields:
http://butlerblog.com/2010/09/27/adding-custom-fields-in-wp-members/
Ok I know I am screwing up somehow This is what I am putting in on my main page
Thank you so much for wanting to join us in prayer for the lost of the world. If you are a current partner please sign in here.
Welcome partners. Please click here for our site
when I login at the page it goes to a completely blank page. no words at all. on local host it was working just fine. I uploaded and updated the version at the same time what am I doing wrong??????
Thanks
when I look at the comment above it didn’t have the more tag where I put it in because the code went away. the more tag is after the please sign here. more tag
then
Welcome partners
here is a trial password so you can see what i mean
username= trial
password = password
the main page is http://www.nlccenter.com/blog
now the registration form doesn’t even come up so I don’t know what’s up. Please help
Ruthie – I would recommend that you delete the plugin entirely (in the WP Plugins tab, deactivate, then select delete), this will clear out all of the plugin’s settings. Then do a full and clean reinstall.
If that does not solve things for you, please contact me via this site’s contact form and I’ll take a look at it.
Hello Chad,
I found WP-Members recently as I was searching for a plugin that would allow me to make some of my client’s content password protected and visible only to registered users of the site.
The plugin seems to be great, but I’m having an interesting problem!
The login form and the text above it (this page is only for registered users, etc) appears twice on the pages that are password protected. Have you ever heard of such a problem? I really would like to make it work as your plugin seems to be what I need exactly.
Thanks in advance for your help,
Burak
PS- If you would like to see what I mean, an example password protected page is at http://www.kidsland.com.tr/haftalik2
Hi Burak – thanks for your comments. The issue you have arises when there are multiple instances of “the Loop” on a single page. I took a look at your site, and in your case, this is occurring in the head of the html document. Most often, this is either your theme or a plugin. In looking at the generated source, I could not tell if your theme is totally customized, or if you worked from another framework, so I don’t know if that’s it. If you are using some type of SEO plugin that uses the loop to generate head content, then that’s probably it.
The way to find out what you have that is incompatible is deactivate all plugins except WP-Members, logout, then test the site. If the problem is still occurring, it is in your theme. If not, bring up your plugins one by one, logout and test each time to determine where your incompatibility is.
If it is in your theme, it’s more of an easy fix. Look at your header.php file (or wherever the header is generated). Most likely you have a customized function there that is calling an instance of the Loop. Remove that and you should be fine. (Or, if your theme has options, such as Arras theme, you might be able to install one of the popular SEO plugins such as All-in-One and it will no longer fire that function).
If it is an incompatible plugin, you are going to have to decide whether that plugin is important enough to keep, and if so, are you willing to make non-upgradeable modifications to work around the issue.
Hope that helps.
Hello Chad,
Thank you very much for your reply, deactivating the SEO plugin solved the issue. I’ll try other SEO plugins and settle with one that doesn’t cause the issue if I find one
There are always alternative ways for SEO, so my priority here is WP-Members!
Thanks again for your help…
No problem – as long as whatever you use does not run a second instance of the Loop, you’ll be fine.
Hi I had a similar loop problem using iThemes and Builder Core, had the login form and registration form looping in the sidebar as well as the content area… the solution I found was to remove ‘widget contet’ areas from the sidebar and just insert plain HTML or standard WP widgets.
Hope this helps a bit!
Hi Chad -
This is a great plugin. We are having a small issue though – is there a way to restrict wp-members users to a particular WP user rather than add all users to wp-members by default? We have an interesting problem where if you are logged into the WP dashboard and try to view the live website, we are directed to the protected pages by default. I assume this is because all users are also wp-members users as well. It’s making it very difficult to update the site (constant logging in and out to see the live site). Any thoughts?
Thanks
Beth
Hi Beth – thanks for the comments. There are a couple things to clarify. First, WP-Members uses the WordPress user table. This is to maximize compatibility with both WordPress itself and any other plugins that might use user information. So there is no difference between “wp-members” and “WP users.” Also, the plugin registers users with whatever the default role you have set in your WP settings (if you haven’t changed anything in this regard from the WP install, it is “subscriber”).
The only difference between being logged in and logged out is whether the content is viewable or if it is replaced by the login/registration, so I’m not sure why you are needing to login/logout to view the site. I guess that just comes down to how you manage your process flow. If it bothers you that much, I’d say use a second browser (such as one IE and one FireFox) as login state is maintained using cookies. Then you can be logged in with an admin role in one and not in the other.
Thanks, Chad. We actually found a way around it when editing by adding an extra link to the site. But your reasoning here makes perfect sense to me. I think that we are just using the plugin in a more unconventional way than others. Thanks, again!
Hi,
I am using my WP site as a photography site and was wondering if using this WP Members plugin you can have it as a client log in so once they log in it takes them directly to there commissioned pictures.
Many Thanks
Rob
Hi Rob – thanks for the comments. The plugin operates in an all-or-none kind of way. I think that you would need some way of separating user access based on each user login (i.e. user A can see anything tagged for user A but not anything belonging to user B or C). Unfortunately, this plugin doesn’t do that.
Ok,
Thanks for your assistance Ill keep looking for one.
Rob
Hi Rob,
I am looking for a log in plugin like you described above. Have you been able to find one?
Thanks!
Hello Chad
This is a great plug-in. Well done.
My blog is for a nursery school where all but the home page and ‘about us’ is available only to registered users (staff and parents). The blog should be completely off-limits to the public.
I know how to protect pages and blogs, but the summary blog page always shows the excerpts. I’d like to be able to do one of the following:
1) Block the entire blog page – just show the registration/login box.
2) Show blog titles only.
3) Reduce the size of the excert to no more than 2 lines, or equavalent characters.
Many thanks
Paul
Hi Paul – changing the excerpt length is pretty easy, which would cover point 2 or 3 (because you could make it zero to any number). Your theme should have a functions.php file (if not, create a file named functions.php and save it to the folder of your active theme). Put the following in your functions.php:
add_filter('excerpt_length', 'chg_excerpt_length'); function chg_excerpt_length($length) { // set the number to whatever number of // words you want the excerpt to be. return 20; }The return value of this function is the number of words your want in your excerpt.
So, is there no option for Paul Warn’s point #1? I too would like to do the same thing. I don’t want to show excerpts or not excerpts. I don’t want them to see anything.
I’ve turned off search, so I don’t have to worry about that, but have “category” pages that I don’t even want people to see the titles of the posts unless they have access to that “category” page.
http://butlerblog.com/2011/10/04/blocking-content-in-a-custom-template/2/
That pretty much answered what I needed. I applied that method to the category template. Works fine now. I probably need to do this to “single post” template as well.
This is great…thanks!
hello- I have a question I wanted to set up part of my blog to where someone pays for a product on one page and then gets emailed a password to access to a tutorial on a page. Can this be done with wp-members? Also who sets up passwords? Does everyone use the same one?
There isn’t a built in payment gateway, although many of the plugin’s users that do utilize payments have the plugin set to moderate registration (admin approval). Passwords are generated for each user by the system, but once they log in, they have the opportunity to set their own password.
So I would have to set my own payment gateway is that correct? Like paypal. Then I would direct them to register?
yep
I’m having an issue with my login form in IE 7. I’ve tested in Safari, Firefox, and Google Chrome, without any problems, but the login form isn’t allowing users to login in IE7.
Can you tell me if there is a bug? You can preview here:
http://moderntrousseau.com/2011/07/19/store-support/
Hi Lynn – there are no known bugs with IE7
Were you able to preview the sample page in IE? Can you tell me why the login fields won’t allow me to type in a username/password. Even when I try to cut and paste the username/pass it gives me an error code.
Any suggestions? The login page otherwise works just fine in Firefox, Google Chrome, and Safari.
Lynn – I took a look in IE and can enter in both fields (I am able to get a login failed message since I don’t have valid credentials). Are you just not able to enter data in the fields or able to enter data in the fields but not validate?
I think it’s just not validating in IE7.
Here’s a test login for you to try:
U: test
P: password123
I have a question about different levels of membership. How do I protect a post that is accessible by a s2Member Level 2, but not an S1 member?
WP-Members does not support different membership levels
What do “s2Member Level 1″ & “s2Member Level 2″ control/activate?
Hi! Can I somehow show main menu and the footer on a blocked page? At the moment all content of the blocked page is hidden. Thanks so much for a fantastic plugin!
Thea – blocking only occurs within the Loop, so if you have a properly constructed theme, header, footer, menus, and sidebars should display regardless of whether a user is logged in.
I’m having trouble with blocking pages. I did an update today of the plug in and my pages aren’t hidden anymore. I’ve made sure “share excerpts” was unchecked and I’ve used the unblock custom field on pages I want to show since I’ve checked the “hide pages” by default box. I also tried the block custom field on pages I don’t want to be accesible without a login. All the pages I don’t want anyone but members to see are accesible in IE8, Firefox on ubuntu and my browser on my phone.
Unfortunately I can’t let you see the pages since they are related to proprietary stuff. I have made the pages private until I can get this resolved. Any help would be great.
Robert
Ok, I got the pages to work properly and now they don’t display unless someone is logged in. But, to do this I had to remove [[wp-members page=”members-area”]] and [[wp-members page= "login"]] from those pages. The problem is there is no link or place for the members to logout once they’re done with the site.
I tried creating a separate members area page with [[wp-members page=”members-area”]] but it still doesn’t give anyone the option to log out of any of the pages/site. Before the update I used both the “members page” code and the “login” code on all my secure pages and members were able to update there info or logout from whatever secure page they were on.
Robert – let’s start from the beginning. There is no need to use the shortcodes on regular content (posts/pages). These are shortcodes to create special pages for special purposes. For example, the members area page is to manage resetting forgotten passwords, updating registration information, or to change a password. By putting this shortcode on every protected page, you are actually probably confusing your users and the plugin.
The same goes for the login shortcode. If a page is protected, there is no reason to add the login shortcode to the page – a login form is already provided automatically by the plugin.
If you need to provide users the ability to logout of the site, the easiest way to do that is to use the sidebar widget. This provides a login for users that are not logged in and gives login status (their username) and a logout link if they are logged in. (There are a few other ways to provide a logout such as providing a link to yourdomain.com/?a=logout )
Thanks for the info Chad. I think I’ll use the sidebar widget. I appreciate your input.
Robert
Thank you so much for creating this great plugin! I have the login widget on the sidebar for purposes of logout, but when someone goes to a blocked page they see the login form in the content and on the sidebar. Is there a way to remove the login form from the content area and just have it show on the sidebar? Thanks.
You can remove the registration form from the body area, but not the login. That is the designed flow of the plugin. The sidebar is actually the optional part, not the body as not every template uses a sidebar on content pages (WP default TwentyEleven is a good example).
Hello. Thank you for the plug-in. I’ve looked through all the info available and still can’t figure out how to do what I want. I have a picture in a sidebar… people can click it and a pdf file is opened in a new tab. I would like them to have to sign in to access this file. Can you help?
Thanks
Hello. The plug in works great on my site and blocks the pages I want. However, I started using a custom page template (http://guff.szub.net/source/page-authors-2.0.php) to be able to list all of the subscribers in a list form as a directory on one of the pages that I blocked and now I can no longer block that page. Is there something I can add to the template to make the page block? Thanks.
Hi Doris – you correctly identified this as a custom template. It’s not a page in the WP sense of the word. WP-Members only directly blocks content that is managed withing the WP structure of Posts and/or Pages (again, in the WP definition) using the Loop. This is a template that does not use an instance of the Loop.
That being said, yes, you can still block the content. It’s not too complicated, it just requires some adjustments to your template using a conditional statement around the WP function is_user_logged_in(). I put together an example of how to do this here.
Thanks. It did work to a certain extent, but the protected information shows up on the bottom of the page after the login boxes.
You might want to check to make certain all the content components are within the logged in condition. I know for a fact that this works seamlessly because the template you referenced above is what I used to test this method before I wrote this example post.
I’m sorry, I am not much of a coder. Is this the login condition: <?php
if( is_user_logged_in() ) {
// my wp_query here…
} else {
if (function_exists('wpmem_securify'))
{
// display loging prompt as on other pages
echo '’ . get_the_title() . “”;
wpmem_securify();
the_content();
}
}
?>
? If it is I placed it in after and it still shows. Did I put it in the correct place?
I’m guessing that you put that entire code snippet and then the content? Your content that you are trying to protect goes where it says “my wp_query here,” although depending on the code that’s going in there, you may or may not need to close the php tags. Take a look at the example post (which I actually just updated so that hopefully it’s a little more cut/paste friendly – although you still will need to do some coding edits to fit specifically for your needs.)
Your content will need to go between
<?php if( is_user_logged_in() ) { ?>and
<?php } else {Hope that helps clarify.
I know this would be the perfect solution if could get it to work. What is my content?
I think I got it..crosses fingers…
I don’t want the blocked pages to show on the header or footer unless the user is logged in. Is there a way to have this set like this?
I put together an example to work from here.
Hi. I’m liking the plugin so far. Is there a way to customize the text in the email once a user registers?
Not at this time (although you could edit the content in wp-members-email.php, noting that any changes would be overwritten in the event of an upgrade).
The upcoming version 2.7 will offer the admin the ability to customize the emails through the plugin options panel. (There will probably be one fix release prior to 2.7, though)