Shortcodes

Shortcodes List

Paid Member Subscriptions comes with a list of shortcodes that you can use right away:

  • [pms-register] – Generates a Registration form that allows users to purchase your Subscription Plans
  • [pms-login] – Generates a Login Form
  • [pms-logout] – Displays the Front End Logout Text and Link
  • [pms-account] – Generates the Account Form that allows the users to manage their information and Subscription Plans
  • [pms-recover-password] – Generates the Recover Password Form
  • [pms-restrict] – Restricts content inside a post or a page so you can have content that’s protected and content that’s not protected in the same page
  • [pms-payment-history] – Adds a Front End Table with the Member’s Payment History
  • [pms-action] – Lets you generate a direct link to an action (retry payment, renew etc.)
Shortcodes work only on pages that are created by the Admin. This is to prevent users, who can post but are not Admins, from using them.

Member Registration form

In order to generate the Registration Form follow the steps below:

  • Create a new page and name it appropriately, for example Register or something similar
  • Add the [pms-register] shortcode inside using the Text Editor (not Visual)
  • Hit “Publish” and you’ll be prompted with a Registration Form in the Front End

All the Subscription Plans created in Paid Member Subscriptions -> Subscription Plans will be displayed inside the Registration Form.

Paid Member Subscriptions - Shortcodes - Registration Form

Front End Registration Form

Paid Member Subscriptions - Shortcodes - Registration Form in Front End

Parameters

1
[pms-register subscription_plans="" plans_position="" selected=""]
  • subscription_plans – A comma separated list of Subscription Plans IDs to list only certain Subscription Plans, or you can use “none” to allow users to register without becoming members (to not list any Subscriptions Plans). If this attribute is not set, all active Subscription Plans will be displayed
  • plans_position – Where to display the Subscription Plans in relation to the Register fields. The parameter can use the values “bottom” or “top” and the default is set to bottom
  • selected – The ID of the Subscription Plan that should be selected by default when we display the Register form

Example of parameters used inside the [pms-register] shortcode

1
[pms-register subscription_plans="17,18,19" plans_position="top" selected="18"]

The above shortcode, will create a Registration Form that will list the Gold, Silver and Free Subscription Plans and position them above the rest of the fields. By default the Silver Subscription Plan (with the ID 18) is selected.

Paid Member Subscriptions - Shortcodes - Registration Form Parameters

Allow Users to Register without becoming Members

You can allow users to register on your domain without subscribing to a Subscription Plan by using the “none” value inside the subscription_plans parameter like so: [pms-register subscription_plans=”none”].

All users that will use this Registration Form will register as a normal user.

Paid Member Subscriptions - Shortcodes - Registration Form without Subscription Plans

Allow logged in users to become Members

If you already have users on your website and you want them to purchase a subscription plan, all they have to do is login to their account and then visit the page with the [pms-register] shortcode.

The page acts as the main way for users to purchase Subscriptions, while also allowing them to register for an account on your website if they don’t already have one.

Registration form viewed as a Logged in User

Choose which subscription plans to show

This can be done through the `subscription_plans` parameter. This parameter takes a comma separated list of Subscription Plan IDs to list only certain plans.

Example:

1
[pms-register subscription_plans="1,2"]

Will show only plans with ID 1 and 2, the others will be hidden from the form.

Pre-select a subscription plan through an URL parameter

You might want to create a better presentation for your subscription plans and what they offer through a Membership Pricing Table and when the user selects a plan, he should be sent to the subscription form with the plan pre-selected.
This can be achieved by adding the subscription_plan parameter to the URL of your subscription page.

In case you’re looking to link to a subscribe form containing just this specific plan (and excluding the others) you can use a second URL parameter: single_plan=yes.

Example:
The URL of your page is: https://website.com/subscribe and the id of the plan you wish to be pre-selected is 15.

The link to pre-select this plan would be: https://website.com/subscribe?subscription_plan=15

The link to pre-select this plan and exclude others would be: https://website.com/subscribe?subscription_plan=15&single_plan=yes

These URL parameters are available starting with version 1.8.4 of Paid Member Subscriptions.

Login Form

In order to generate the Login Form follow the steps below:

  • Create a new page and name it appropriately, for example Login or something similar
  • Add the [pms-login] shortcode inside using the Text Editor (not Visual)
  • Hit “Publish” and you’ll be prompted with a Login Form in the Front End

The Login Form allows your users to login from the Front End of WordPress, instead of the default WordPress Login Form.

Paid Member Subscriptions - Shortcodes - Login Form

Front End Login Form

Paid Member Subscriptions - Shortcodes - Login Form in Front End

Parameters

1
[pms-login redirect_url="" logout_redirect_url="" register_url="" lostpassword_url=""]
  • redirect_url – Will redirect the user to an url of your choosing after a successful login
  • logout_redirect_url – Will redirect the user to an url of your choosing after log out
  • register_url – Adds a link to the Register Form
  • lostpassword_url – Adds a link to the Recover Password Form

Redirect User after Login

Paid Member Subscriptions makes it really easy to redirect users after login to any URL by using the redirect_url parameter.

Example:

1
[pms-login redirect_url="https://www.yourdomain.com/account"]
The redirect will NOT work if it’s pointing to an outside URL, it needs to point to a page on your site.

Add Register and Lost Password? links below the Login form

You can add a “Register” and a “Lost your password?” link below the Login form using the register_url and lostpassword_url parameters.

Example:

1
[pms-login register_url="https://www.yourdomain.com/register/" lostpassword_url="https://www.yourdomain.com/recover-password"]

Front End Login Form

Paid Member Subscriptions - Shortcodes - Login Form using Parameters

Member Account form

In order to generate the Account Form follow the steps below:

  • Create a new page and name it appropriately, for example Account or something similar
  • Add the [pms-account] shortcode inside using the Text Editor (not Visual)
  • Hit “Publish” and you’ll be prompted with an Account Form in the Front End

The Account Form will allow your members to View, Upgrade, Renew, Cancel or Abandon their Subscription Plan, and also to modify their information like Email, First Name, Last Name and Password on the site.
In case their initial payment when creating an account failed, they will also be able to Retry the payment.

Paid Member Subscriptions - Shortcodes - Account Form

Front End Account Form Logged In Member

Please take note that the Renew link only appears if there are 15 days or less until the users subscription expires. If you’re interested in how to modify this click here.

Parameters

1
[pms-account show_tabs="no" logout_redirect_url=""]
  • show_tabs=”no” – Only shows the first tab (Subscriptions) and removes the navigation from the shortcode
  • logout_redirect_url=”” – If not empty, defines the redirect URL when a user logs out

Front End Account Form for Logged Out Member

If a logged out user is visiting your page with this shortcode, he will be shown a login form so he can login and view his account information.

Do not display tabs in Account Form

You can display only the Subscription Plans inside the Account Form using the show_tabs parameter.

Example:

1
[pms-account show_tabs="no"]

Subscription Actions

Retry Payment

The Retry Payment option appears if the user didn’t successfully pay for the subscription and the status is pending.
This option can be used by the user to reinitiate the payment either by sending the user to the payment gateway or showing the credit card details form.

Upgrade

The Upgrade option lets users purchase higher ordered subscriptions from the same tier.
This option will only appear if there is an upgrade available.

You can read more about Subscription Plans here.
Renew

The Renew option gives your users the possibility to manually renew a subscription plan.
This option appears for users that have Canceled or Expired subscriptions and also for users of Active subscriptions, which have 15 days or less remaining on their subscription.

If you want to make the button show sooner for Active subscriptions, please see instructions here.
Cancel

The Cancel option gives your users the option to stop recurring subscriptions. The status of the subscription will be set to Canceled and it will expire after the Expiration Date.
These users will still have access to your restricted content until the expiration date has passed.

Abandon

The Abandon option will completely remove a subscription from a users account. Recurring payments will be canceled and any access to restricted content will be revoked.
The user will need to purchase a subscription plan again from a page with the [pms-register] shortcode.

Logout Link

In order to generate the Logout Link follow the steps below:

  • Create a new page and name it appropriately, for example Logout or something similar
  • Add the [pms-logout] shortcode inside using the Text Editor (not Visual)
  • Hit “Publish” and you’ll be prompted with a Logout Link in the Front End

The Logout Link allows your users to logout from the Front End of WordPress.

Generate Action Link

In order for this feature to work, you need to select the page with the [pms-account] shortcode by going to PMS -> Settings -> General.

Subscription actions are part of the [pms-account] shortcode. They are shown on the Subscriptions tab and let the user manage his subscription. For more information click here.

Using a shortcode, it is possible to display these actions on other pages, prompting the user to renew, retry the payment and more.

Usage

1
2
3
[pms-action]
  Your last payment has failed, {{retry}}click here{{/retry}} to try again.
[/pms-action]
The content that you place inside the shortcode will be displayed only if that particular action is available.

The action is chosen based on the tags you are using to wrap your link text. In the example above, we use the {{retry}}…{{/retry}} tags in order to generate a Retry Payment link. You need to replace this with the action that you need to generate the link for. Available actions are:

  • retry
  • renew
  • upgrade
  • cancel
  • abandon

If no tags are added inside the shortcode or if the closing tag is missing, the shortcode will not return anything.

To verify that in the scenario you’re testing a particular action is available, visit the page with the [pms-account] shortcode.

Multiple Subscriptions per User

If the user has more than 1 subscription, when generating the URL, you can add a shortcode parameter to specify to which subscription plan the action you are defining refers to:

1
2
3
[pms-action plan_id="123"]
  To renew your subscription, {{renew}}click here{{/renew}}.
[/pms-action]

So we added the plan_id parameter to the shortcode, alongside the id of the plan we’re looking to target (123 in the example).

Return only the URL

The shortcode can be used to return only the URL for the Action instead of the HTML markup. This is useful in a scenario where the markup is generated by something else (a button generated by your page builder for example) and you only need the correct URL appended.

Usage:

1
[pms-action]{{upgrade}}{{/upgrade}}[/pms-action]