If you want to protect a section or sections of a post or page then simply wrap the section with the “emember_protected” shortcode.
The following screenshot shows an example of how a partially protected page may look like. You can protect multiple sections of the post/page using multiple blocks of section protection shortcodes.
Section Protection Video Tutorial
Take a look at the following shortcode examples. It will show you how you can use the partial protection feature:
Note: When you copy and paste the shortcode, make sure to paste it in the “Text” mode of the page editor to prevent any HTML code from getting copied.
Simple Section Protection Example
[emember_protected] Whatever content goes here is only visible to logged-in members who have access to this post or page. [/emember_protected]
Section Protection for Specific Membership Level Example
[emember_protected for="2-3-4"] Whatever content goes here is only visible to members who belong to the specific membership level specified above. [/emember_protected]
Where 2,3,4 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 visible to the member whose 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 shortcode:
[emember_protected scope="verified_users_only"] Whatever content goes here is only visible to anyone who is logged-into the eMember system as a user (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 shortcode (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 visible to a non-logged in user (anonymous visitors of your site will see this message). [/emember_protected]
Section Protection for Expired Members Only
If you want to just protect a section of a page for expired members (only expired members will see the message) then use the following shortcode:
[emember_protected scope="expired"] Only the expired members will be able to see this message. [/emember_protected]
If you want to protect a section of a page for expired members of a particular level then use the following shortcode:
[emember_protected scope="expired" for="2"] Only the expired members from membership level 2 will be able to see this message. [/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 shortcode (can be useful if you don’t even want them to know that there is a section of content there):
[emember_protected for="2-3-4" do_not_show_restricted_msg="1"] Whatever content goes here is only visible to 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]
Section Protection without the Protected or Expired Message
The following section protection option protects the section without showing the “Content is protected” or “Account is expired” message (useful if you don’t even want them to know that there is a section of content there):
[emember_protected for="2-3-4" do_not_show_restricted_msg="1" do_not_show_expired_msg="1"] Whatever content goes here is only visible to members who belong to the specific membership level specified above. Users who do not have access to this content won't see a "Content is protected" message. The expired members won't see the "Account is expired" message. [/emember_protected]
Section Protection Not For Specific Membership Level
If you want to protect a section and make it NOT visible to a particular membership level then use the following shortcode:
[emember_protected not_for="1" do_not_show_restricted_msg="1"] Whatever content goes here is NOT visible to members of membership level 1. All the other members can see this content. [/emember_protected]
Using a Custom Message for the Non Members
This section protection shortcode can take another extra optional argument which can help you customize the text/message that is shown to non members.
Here is an example usage:
[emember_protected for="2-3-4" custom_msg='This is a custom message'] The content goes here. this content will be hidden and only available to members of membership level 2, 3 or 4. [/emember_protected]
The following screenshot shows how this custom message is shown:
Section Protection Custom Message with HTML Link
You can use a HTML link in the custom message that you specify for the section protection shortcode. Remember to switch to the “Text” mode in the WordPress post/page editor if you are typing in HTML link code.
Here is an example shortcode usage:
[emember_protected for="2-3-4" custom_msg='This is a <a href="http://www.example.com">test link</a>'] The content goes here. this content will be hidden and only available to members of membership level 2, 3 or 4. [/emember_protected]
Note
Just remember that when you want to use section protection on a post or page you should not protect the full post or 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).
Section Protection in Action
You can see an example of how the section content protection work on the eMember demo site.