Create Member Only Pages and Posts in WordPress

Create Member Only Pages and Posts in WordPress

Hiding Wordpress Pages / Posts From Non-Members

Simply use the following shortcode at the top of the page or post to make the content of the page/post accessible for members only:
Notes
[memberonly]

Protecting Part Of The Content

You may place the shortcode in the middle of the page/post to restrict content below the shortcode to members only, and make content above the shortcode available to the public.

You can also enclose content you wish to restrict by using the closing [/memberonly] shortcode. For example:
Notes
[memberonly]This content is members only.[/memberonly]

Who Gets To View Member Only Content?

By default, only members who are in your Members folder, whose membership is not expired, can view the member only content. You can modify which folder the account must be in (discussed below). You can also modify how long after membership expiration before the member is unable view the member only content. This setting is found under Organization Settings > Integration > Membership Settings. To disable membership expiration checking, enter the number of days as 999.

Restricting Content To Certain Membership Levels Or Labels

You can restrict content access to members with a specific membership level or label by adding a label to the shortcode. For example:
Notes
[memberonly label="business member"]

To restrict content access to multiple membership levels or labels, separate them with commas. For example:
Notes
[memberonly label="membership committee,marketing committee"]

If your label or membership level name contains a comma, you should escape the comma. For example:
Notes
[memberonly label="label%2C1,label%2C2"]

Restricting Content To Members In Specific Folders

You can restrict content access to members in a specific folder by adding a folder to the shortcode. For example:
Notes
[memberonly folder="Sponsors"]

To restrict content access to multiple folders, separate them with commas. For example:
Notes
[memberonly folder="Members,Pending"]

Displaying Content To Non-Members

You can display content to non-members by adding false to the shortcode. For example:
Notes
[memberonly false]

You can combine this with labels/folder restrictions. For example:
Notes
[memberonly folder="Members,Pending" false]

Displaying Different Content To Different Members

You can display different content on a page depending on membership level, labels or folders by using memberonly content blocks:
Notes
[memberonly level="Gold"]Content for gold members[/memberonly]

[memberonly level="Silver"]Content for silver members[/memberonly]
[memberonly level="Bronze"]Content for bronze members[/memberonly]
[memberonly level="Gold,Silver,Bronze" false]You are not a member[/memberonly]

Non-Member And Error Messages

You can configure the messages displayed to the user when they are not permitted to view the content under Plugin Settings.

Additional Options

You can customize the message displayed to non-members or members not allowed to access content by adding a message to the shortcode. For example:
Notes
[memberonly message="..."]

You can display no message when the user is not allowed access to the content, whether because the user is not logged in (note that the login form still appears unless you also use the nologin option below), does not have the required folders/labels, or if membership expired, by adding nomessage to the shortcode. For example:
Notes
[memberonly nomessage]

You can omit the sign-in box for non-members by adding nologin to the shortcode. For example:
Notes
[memberonly nologin]

You can combine options, such as displaying a custom message and omitting the login box. For example:
Notes
[memberonly message="..." nologin]

You can redirect non-members (or members not allowed) to a different page (replace ... with the url) by adding a nonmember-redirect to the shortcode. For example:
Notes
[memberonly nonmember-redirect="..."]

You can display the membership sign-up form to non-members with the following shortcode:
Notes
[memberonly nonmember="join"]

You can display a form or cart to non-members with the following example shortcode:
Notes
[memberonly nonmember="!form/..."]