Available Shortcodes

« MemberPress Users Manual

- Shows a link to the Account page in MemberPress. Can be used on any page or post.
[mepr-group-price-boxes group_id="123"]
- Helpful if you want to place content above and below the group pricing boxes. If you're using this on the Group page itself, there's no need to specify a group_id. If you want to use it elsewhere on your site, you will need the group_id attribute on it.
[mepr-membership-link id="0"]
Link text in here [/mepr-membership-link] - Shows a link to the Membership identified by "id".

[mepr-membership-access-url id="123"]Link text here[/mepr-membership-access-url] - Uses the Membership access URL set in the "Membership access URL" setting under the Membership Options section. Use this anywhere on your site to give the member a link to the Membership access URL.

[mepr-membership-registration-form] - Helpful if you want to place content above and below the Membership registration form. Can ONLY be used on the Membership page.

[mepr-membership-registration-form id="123"] - You can use this shortcode on any WordPress page, post, or custom post type to display the membership registration form of a specific membership. Simply replace 123 with your own memberships unique ID. Where to find a Membership's ID? IMPORTANT: When using this, you'll most likely need to also enable the Global CSS option your Options > General of MemberPress to prevent errors from appearing on the form.

[mepr-offline-instructions gateway_id="abc-123"]Custom message here.[/mepr-offline-instructions] - This shortcode can be used on your thank you pages to display any type of message specific to users who registered via your offline gateway option. For gateway_id="abc-123", enter your gateway's ID. Could be used to provide additional instructions for users when they purchase your membership through your offline gateway. Note: Though we designed this specifically with offline gateways in mind, it can be used successfully with the gateway ID of any other MemberPress supported gateway.

[mepr-show] and [mepr-hide] - Both shortcodes support if="X" attribute, where "X" can be "loggedin" or "loggedout". Both shortcodes work on whether the user is logged in or logged out, and does not care what, if any, Memberships the user has purchased. Examples of this could be: [mepr-show if="loggedin"]You’re logged in, congratulations![/mepr-show] [mepr-show if="loggedout"]You’re now logged out![/mepr-show]

[mepr-active {parameters go here - see below}]Content to protect in here[/mepr-active] - Used to show or hide content on pages throughout your site. This shortcode supports the following parameters (parameters marked with * are required. Only one parameter in red below can be applied per shortcode):

Shortcode Parameters Description
rule(s)* If you plan to use a single Rule ID, then set this to rule="X". If you plan to use multiple Rule ID's, then set this to rules="X, XX, XXX". Where X's = the ID's of the Rule(s). Where to find a Rule's ID?
membership(s)* If you plan to use a single Membership ID, then set this to membership="X". If you plan to use multiple Membership ID's, then set this to memberships="X, XX, XXX". Where X's = the ID's of the Membership(s). Where to find a Membership's ID?
ifallowed* When set to ifallowed="show" the content in-between is shown to authorized members only. When set to ifallowed="hide", the content is hidden from authorized members.
unauth If set to unauth="message" - the user will be shown the unauthorized message when they are not authorized. If set to unauth="login" - the user will see the login form when they are unauthorized. If set to unauth="both" - the user will see the default unauthorized message followed by the login form. NOTE: when set to, "message" or, "both" the code will not display any custom unauthorized message you have set for your rule(s). It only works to display the default unauthorized message.
unauth_message Use this to override the default unauthorized message. This only applies when the "unauth" attribute above is set equal to "message" or "both".

An example shortcode using all above attributes might look like the following:
[mepr-active rules="1, 2, 3" ifallowed="show" unauth="message" unauth_message="Download link hidden, please login or purchase a membership to view."]<a href="#">Download Link Here</a>[/mepr-active]

The above two shortcodes are both identical. They show login/logout links. Can be used anywhere.

[mepr-login-form use_redirect="true"] - Shows a login form on a page or post. Can be used anywhere. When use_redirect = true, MemberPress forces the redirect URL setting, located in the Options or on the Memberships, to be used rather than keeping the member on the same page.

[mepr-account-form] - Shows the user account information

[mepr-unauthorized-message] - Shows the unauthorized message wherever this is placed.

[mepr-account-info field="slug"] - Displays the user meta field which is chosen by "slug"

Slug Result
full_name John Doe
full_name_last_first Doe, John
first_name_last_initial John D.
last_name_first_initial Doe, J.
first_name John
last_name Doe
user_login johndoe
user_email [email protected]
nickname johndoe
description (aka Biographical info)
mepr-address-one 123 Fake Street
mepr-address-two Apt. 123
mepr-address-city Vidor
mepr-address-state Texas
mepr-address-zip 77662
mepr-address-country USA
mepr_user_message The "Custom MemberPress Account Message" you have defined for the member in their profile
user_registered The date/time the user first joined your site
display_name johndoe
ID The unique ID assigned to the user upon registration. Must be entered as ID, not id.
"Your custom Slug" Any of the Custom Account Field slugs in the MemberPress options.