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.

Hey, love the plugin!
I have your login widget setup on the left sidebar. Problem is if a users hits a protected post – he comes up seeing login for in the widget and in the protected post area. How do I prevent the latter? Thanks!
RB
Hi Rob – I’m glad you like the plugin. The behavior you described is part of the process flow of the plugin. A login will always display for protected content if the user is not logged in.
Thanks. This results though in two login forms side by side – I want to rely on the login widget in the sidebar……
I hear what you are saying, and that might make sense for something that was a customized site specific solution. But in the one-size-fits-all world of WP plugins, you have to consider that not every page/post template utilizes a sidebar (WP default twentytwelve theme for example).
OK – thanks for responding.
I have installed the plugin and have gone thru all settings. When I login, it gives me full access to the admin site. I added the patch to the function PHP and it now doesn’t show the main toolbar, but still shows the “edit” button, which takes you right back to the admin site. What I am looking to do is only allow access to certain pages after login, nothing else changes. What am I doing wrong and how do I correct it?
Thanks for your help!
Are you logging in with your own username?
Hi Chad! Thank you for this great plugin! Unfortunately I have a little problem with it. I have set up a restriction to registered members. If you watch the restricted content before logging in, you can see an message that you do not have the rights to see it. So it’s ok, but after this you log in and you still can’t see it. You have to force refresh the page to see that you are actually logged in, and then you can see the restricted content too. How could I eliminate this annoying force refresh step and fix the problem? Thank you for your help!
It’s possible that you have something interfering with the process of validating that a user is in a logged in state. This all occurs before anything is sent downstream to the browser. It could be something like a cache plugin, but could be something else as well. I would suggest testing with plugins disabled and bringing them back up one by one, testing login each time. That will help you determine if you can rule out any plugin conflicts. If that’s not it, test the same way with the default theme to see if it’s something in your theme.
Hi,
Let me say thank you for this great plugin!
I have installed the plugin and have a problem when i tried to register with another username and email. But its not delivered to another email also mine. So, i have to activate new user manually from my primary account (dashboard).
Would you tell me how i can fix that ?
Thank you again
The plugin uses the WP function wp_mail for sending. You need to verify that wp_mail is functioning properly. (Before that though, you should verify that there wasn’t a delay in sending, or that it didn’t just go to your junk mail folder.) There are some suggestions in the FAQs for troubleshooting, and you could also visit the WordPress forums.
Chad, awesome plugin! I work for a nonprofit that offers peer support, so it’s important to protect certain information.
Quick question … we’re fiddling with bbpress, and I wondered if there’s a way — because you can’t add Custom Fields (at least not thru the admin) — to protect Forums and forum posts?
Any help would be appreciated!
Thanks!
Well, bbpress as a plugin (2.0) is relatively undocumented and there are differences in hooking into it vs the 1.x version. Depending on what you want to do, the forum by itself can require that a user be registered to post but not to read. If you want to block the forums entirely, I haven’t come across the ideal way to do that yet. Currently, I think the simplest way is to use the bbp_template_notices hook and if the user is not logged in, stop the process there.
add_action( 'bbp_template_notices', 'my_bb_check' ); function my_bb_check() { if( is_user_logged_in() ) { return; } else { echo "Sorry. You must be logged in to access the forums."; echo "</div><!-- #content --> </div><!-- #container -->"; get_sidebar(); get_footer(); exit(); } }The code above checks if the user is logged in, and if not, it gives a message, finishes the remainder of the template, and then exits. (Note: you’d need to know where to finish your template – essentially what comes after the Loop.)
Hi Chad,
Love the plugin, thanks for your effort.
I am protecting all my posts, I have the “Show excerpts” option selected in the plugin admin, I have “more” tags in all my posts, and the more tags work perfectly on the page that lists my latest posts… when a non-member clicks “continue reading”, they get redirected to the “log in or register” page (which is great) but for some reason I can not get the post excerpt (stuff before the “more” tag) to appear before the WP-members login and register forms.
Ocassionaly people will arrive at my page from the permalink to the post, and it is crucial fro them to get the “teaser” to encourage them to register, but all they se now is the post title and the register page, and the WP-Members message telling them to register.
I have read read that showing the post excerpt before the login\register forms on a single post is standard functionality of WP-Members, and it is EXACTLY what I am after. I am very confused as to why it is not working for me? Appreciate any help you can provide, and a donation is coming your way if you can help me solve this
Thanks in Advance
Damian – it sounds like you have everything configured correctly, so it does seem strange that the excerpts are not working for you. If you contact me via the contact form and send me an link to an example, I’ll take a look at it.
Hello Chad,
I have downloaded the plugin and have blocked pages. My question is: Can I assign a registered user to only one page instead of all pages that I unblock?
Thanks for your help,
Cara
Hi Cara – I’m sorry, I’m not really clear on what you are trying to do. Are you asking about restricting a specific page to a specific user?
Thank you for your quick response. Yes sir, I want to assign a registered user to one page, besides that pages with general info. For example, I provide a service for users. I want to offer a user to register on the site and then proceed to view their service history on their own page. The site also has pages with general info which are not blocked.
Thanks for your help,
Cara
That’s actually something that isn’t going to be able to be done with the plugin on its own. You would need to have something customized appropriately, probably in the template or perhaps a shortcode, that would display information based upon the specific user’s user ID.
Hi Chad, thanks for the great plugin.
I have spent the day setting it up and as I have plenty of experience with css and php I can see many possibilities for this plugin going forward.
I have had a small issue with the sidebar link to ‘register’, although I have disabled registration in the settings and deleted the registration page I created while testing, the link remains. Could you advise me on where I’ve gone wrong and what steps I need to take to rectify this?
Thanks again,
C.
Sorry about that Chad, I managed to sort it out.
When deleting the registration page link I merely deleted everything after the http:// that I had put in there, however, when hitting the update settings button it actually repopulates with the full link again, thus causing the register link to remain. I didn’t see this the first few times I tried it. The solution was to just delete the entire entry and hit update settings, it would then repopulate with just the original http://.
Maybe this will help someone else if they get stuck on it.
Great work Chad,
C.
I am creating a website that uses categories for the posts. It also has the standard search.
I have unchecked the “show excerpts” box and and not using any “more” tags on the posts.
The posts are not restricted to WP-Members only. (Pages are.)
For some posts, I added the “block = true” field. This works fine when I am logged off and try to click on the post name in the Recent Posts section on the Menu.
Here is my problem/question:
If I search using a term in a blocked post, the post shows up in the search results for all to see.
On the menu, if I select a post category the blocked post is a member of, the post shows up in the result set for all to see.
I would have expected that the blocked post would not come up in the result list. I think that these appearances circumvent the purpose of the block. Have I overlooked something?
Thanks!
You need to be using the ‘more’ tag, otherwise summary templates like archives and search results will display the entire content.
I am sorry for my ignorance…… We have built our company website using the Mingle theme of WordPress. I installed the WP-Member plug-in to restrict the access to our pricing pages unless the person has become a member and is logged in. I have unchecked the block posts and block pages boxes in the settings. My question is how and where do I enter the block = true so that I can lock the one page that will have the pricing? I don’t know what you mean by a “custom field” in the instructions……….
Also, I don’t see how to enable a “lost username or password” in case a member can’t remember how to log in. The box in the sidebar just gives a field to enter user name and password.
Thanks.
Custom fields are meta for posts and pages and are part of the post/page editor. See Override the Default Setting for Posts/Pages on page 3 of the Quick Start Guide. There is a screen shot there to show you.
A forgot password link will show in the login if you set the location of the Members Area in the plugin’s settings. See page 4 of the Quick Start Guide.