How to Protect a Section of a Post or Page
If you want to protect a section or sections of a post or page then simply wrap the section with the “emember_protected” tag. Take note of the the following examples:
Simple Section Protection Example
[emember_protected]
Whatever content goes here is only viewable by logged in members who have access to this post
[/emember_protected]
Section Protection for Specific Membership Level Example
[emember_protected for=1-3-5]
Whatever content goes here is only viewable by members who belong to the specific membership level specified above.
[/emember_protected]
Where 1,3,5 are the membership level IDs that you want to allow access to this section of content.
Section Protection for a Specific Member
[emember_protected member_id=1]
Whatever content goes here is only viewable by a member whos Member ID is 1.
[/emember_protected]
Section Protection for Anyone Who is Logged In
If you want to just protect a section of a post or page for logged in member (you don’t care if the member’s status is expired or not) then use the following shortocde:
[emember_protected scope=verified_users_only]
Whatever content goes here is only viewable by anyone who is logged into eMember (doesn't matter if his account is expired or not)
[/emember_protected]
Section Protection for Anyone Who is NOT Logged In
If you want to just protect a section of a post or page for non-logged in member (only anonymous visitors will see this section) then use the following shortocde (can be useful if you only want to show a message to the anonymous users):
[emember_protected scope=not_logged_in_users_only]
Whatever content goes here is only viewable by a non-logged in user (anonymous visitors of your site)
[/emember_protected]
Section Protection without the “Content is protected” Message
If you want to protect a section of a post or page without showing the “Content is protected” message to the non-logged in users then use the following shortocde (can be useful if you don’t even want them to know that there is a section of content there):
[emember_protected for=1-3-5 do_not_show_restricted_msg=1]
Whatever content goes here is only viewable by members who belong to the specific membership level specified above. Also, the users who do not have access to this content won't see a "Content is protected" message.
[/emember_protected]
Warning: Just remember that when you want to use section protection of a post or page you should not protect the “category” that the post belongs to. When you apply category protection for a category all the posts in that category is fully protected (category protection overrides all the small section protections in the post).
You can see an example of how the section content protection work on the eMember demo site.

I have set up three memberships and set all the protections and granted access to appropriate levels.
But when I click on the categories I get all the posts listed but they all say “your membership doesn’t allow access” or something like that.
Help!?
In the “Add/Edit Membership Level” did you give access to “posts”, “pages”, “categories” for these levels? Sometimes people forget to give this global access when creating the membership level.
Hi,
I would like to insert the number of ‘total number’ on the subscription page. On the dashboard_menu file, I found this php code :
count; ?>
How to transform it to integrate the info into a page or post on the blog ?
Thanks for all.
nicolas
Not sure I understand what you mean by
“insertin number of ‘total number’ on the subscription page”
If you can explain a bit more then I should be able to give you guidance. It is probably a good idea to post it on the support forum so we can have a discuss this:
http://www.tipsandtricks-hq.com/forum
Hi,
Great plugin! Is there a template function that can be used? Basically, I want to wrap the_content inside the function of protection for 2 membership levels always, then have another custom field of text above it that is for the teaser content. This is just so I don’t have to be super paranoid when creating posts, and there is a definite “this will show” and “this will not” in my mind because of the different fields I am typing into.
Secondly, is there anyway for the search engines to bypass this, then cache the page (with the premium content shown) and then anyone could see it?
Thanks again!
@Jeffrey, the section protection requires two tags (start and end) so it’s not possible to call one function from the template and have the section protected but there is other ways to do what you are after.
You can use the following bit of code on your template file to protect some content:
<?php
global $auth;
$user_id = $auth-?>getUserInfo('member_id');
if (!empty($user_id))
{
echo "This secret message is for member's only";
echo "Any content here can only be viewed by members";
}
?>
I can give you more sample code if you post what you are after in the forum:
http://www.tipsandtricks-hq.com/forum
Is this a suitable method for protecting file downloads?
For example, can a member who has access to the file download link, simply email the download link to a non-member…?
I need to protect file downloads (mainly pdf’s) at different membership levels i.e.
*Non-subscribers – get to view a link that says “available only to subscribers” or similar
*Free subscribers – get to view free downloads
*Paid subscribers – get to view free + paid file downloads
Potentially there will be more subscription types with downloads only available to them.
Is this possible with eMember?
Best regards, Brian
Hi, The following video will explain more about how content protection works (Video 5):
http://www.tipsandtricks-hq.com/wordpress-membership/wp-emember-quick-setup-and-usage-video-tutorial-132
I cannot get the “teaser content” more tag function to be work at all. I have the ‘more tag’ option checked, I am not restricting any access to categories, only to the posts.
All I get is “Please Login to view this Content.(Not a member? Join Today!)” just like you would if you were restricting access to the entire category or had the ‘more tag’ function turned off. I realize the way you described above would work as well but I don’t need it that customized…just trying to figure out why this ‘more tag’ option is not working for me.
Thank you,
Erik
Are you using it on your blog post or just on a normal page? Can you please post a link to your blog URL?
You can always use the “Section Protection” feature of eMember to get the same effect as the more tag protection if you want to create teaser sections:
http://www.tipsandtricks-hq.com/wordpress-membership/how-to-protect-a-section-of-a-post-or-page-88
I just purchased the eMember plugin. I’m having same issue as Erik, above.
I need to have teaser content display to everyone, then, have a cutoff below which there needs to be protected video viewable to members only.
I have tried the short code listed above but it doesn’t work.
[emember_protected]
[flashvideo file=http://myvideo.mp4 /] (for example)
[/ emember_protected]
But the video still shows to the whole world. AND the teaser content doesn’t display on the home page.
@Bob, did you protect this post under general protection or did you try protecting is for particular membership levels? for example:
[emember_protected for=1-2-3]
Your protected content goes here…
[/ emember_protected]
Hey, i want to protect buttons, links and content inside the theme files and not from editor – based on the membership levels. if it’s first level – show this and if it’s a second level show that. Is there a php code that i can use to do this. Thanks in advance for your response.
@Vasil, this page should have some PHP code samples that will give you ideas as to how to achieve this:
http://www.tipsandtricks-hq.com/wordpress-membership/wp-emember-miscellaneous-tweaks-248
Thanks very much for your answer. This is exactly what i need.
Is it possible to set protections for custom post types as well as pages, posts, and categories?
Thanks.
Yes you can protect custom post types with eMember. The customer posts types are protected the same way the posts are protected in eMember.
If I’ve got a series of tutorials by Billy, a series by John and a series by Joe, can I set up separate membership access to each series? Can I sell separate subscriptions to each of these with eMember within the same site?
Thanks!
Hi, You can setup as many membership levels as you want. For each series you can make this a different membership level and protect it so only people that have purchase that series can view it.
Members can also be members of more than one membership level so if they buy Billy’s and Joe’s they will have access to both series.
Hi!
Haven’t try the plugin yet but am interested in buying the plugin although I don’t understand how you use the word “protect” (?)
For example you say: “If you want to just protect a section of a post for non-logged in member (only anonymous visitors will see this section)”
For me I would write it like that: “If you want to just protect a section of a post for non-logged in member (EVERY LOGGED USERS WILL SEE THE POST EXCEPT anonymous visitors WHO WON’T see this section)”
Or do you mean “Display” when you say “Protect”?
In this case you should say: “If you want to just DISPLAY a section of a post for non-logged in member (only anonymous visitors will see this section)”
Don’t know if you understand my meaning.
For me “Protect” means “Hide” and it seems in eMember it means “Show”
For me the whole article is a bit confusing.
Could you help?
THANK YOU!
Roger
With the word “Protect” we mean that only a member who has permission to see the content will be able to see it. Anyone else who does not have permission won’t see the actual content that is protected (the bit of content between the shortcode).
I have eStore and eAffiliate already. I also have WishlistMember which won’t do what I want.
If my site sells classes with 20 lessons (links), I want the first 2 lessons public for promotion purposes.
If you pay for the whole class then all of the lessons (links) become active.
The section restrictions work in theory. If you paid for class A and browse to class B unpaid, I don’t want all of class B content viewable.
I have hundreds of classes and think using levels would require way to much maintenance.
Think Lynda.com as a good example of what I want to do.
Can that be done with eMember and eStore?
@Mike, You can use something like the [emember_protected scope=not_logged_in_users_only]
this would be used for the section you want non logged in users to see like a list of tutorials with just one or two active links.
Then you can use the [emember_protected for=1-3-5] and set which membership levels can seen the full list of active links. This way it is easier to manage the membership levels as you can specify which levels can see the content.
Does that make sense?
[...] with the correct permission can view the protected section content. How to do it is explained here.Secure RSS FeedsSecure RSS feeds allow your members to view their membership material in their [...]
Ivy,
Simple question. Can I have two different login redirects? For instance for site admins I want them to go to the “Admin Backoffice” while for silver members I want to send them to “Members Area”.
Is this possible. I looked over your site, did a search on your site and didn’t see anything.
Thanks,
RC
You can set a redirection per membership level. So create a separate membership level for your admin user(s) and place the admins in that level. Now you can set this level to redirect to the admin dashboard.
Leave your response!
Get the WP eMember Plugin
Categories
Blogroll
Recent Comments
Tips and Tricks Hot Items
Copyright © 2012 WordPress Membership ® All Rights Reserved | Powered by WordPress | Infinity Remix theme by Tips and Tricks HQ
Log in | Comments (RSS) | Entries (RSS)