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.