Subscriptions allow you to charge your customers for an item on a recurring basis. Using subscriptions you can create a full-featured membership site
with your content gated in any fashion you choose.
In this tutorial, we’ll create a membership site with three different levels:
Bronze content will be available for free for any registered user.
Gold and silver content will have an associated cost.
- Stripe setup
- Getting Started
- Creating a product
Specifically, we need the ‘Gold level’ and ‘Silver level’ subscriptions already created in your Stripe dashboard.
We’re going to create three pages: Gold, Silver and Bronze.
You can have as many pages you want per level, but we’ll use only one initially.
NOTE: If you don’t see a product listed in the dropdown, re-save that product in your Stripe dashboard.
The bronze content will be freely available to any registered user of your site, hence there is no associated product.
Create a ‘bronze’ page as usual in the WordPress dashboard. In the ‘Page’, right hand sidebar, open the ‘Access’
section and click the ‘Locked’ checkbox. Once that checkbox is selected, a list of products is
shown. Don’t select any products from the list to indicate that no specific product is required, only a known user.
Create the ‘gold’ page like the ‘bronze’ page, but after selecting the ‘Locked’ checkbox,
also select the ‘Silver level’ product in the select box that is shown. This limits page access to only
users who have a current gold level subscription.
Create a ‘silver’ page the as before, but this time choose both ‘Gold level’ and ‘Silver level’. You can select multiple values
by holding down the ‘Alt’ button on Windows or the ‘Command’ button on Mac while making a selection.
This configuration allows users with either gold or silver to access the page.
Add the ‘Add to Cart’ link.
Creating a buy button for a subscription is just like a one-time product, since a
subscription is a product, just one with a recurring price:
price value with your own.
Create links for both the ‘gold’ and ‘silver’ items with their associated prices.
We’ll need three users to try out each of the three levels. To do this, we’ll need
three email addresses. Many email providers – including Gmail – ignore characters after a
plus (+) sign, allowing you to create a distinct email addresses that
use the same inbox.
For instance, if my Gmail address is [email protected], then sending emails to the following
addresses all get delivered to my Gmail:
However, WordPress would consider them separate users.
Buy each of the products with the associated email and verify the access.
If you don’t have an email that supports the plus trick, sign up for a free Gmail
account, to do this tutorial.
This process best demonstrates the new user experience on your site.
Canceling a subscription
In the ‘Products’ tutorial, we created an ‘Account’ page (if not, create it now). Clicking on it
will take you to the login page if you are not logged in already. Make sure that you are logged in as the ‘silver’ user.
On the ‘Account’ page there is now a ‘Subscriptions’ section along with payment information. Click on the ‘Silver level’ subscription,
which takes you to information about that subscription item.
There is a ‘Cancel’ link towards the button of the page. You are asked to confirm the cancellation by clicking ‘Cancel Subscription’.
Once you confirm the cancellation you are taken back to the ‘Accounts’ page where the subscription no longer shows up. Note that
the payment for the subscription is still there, just the active subscription is not.
Updating a payment method
The ‘Update’ action is on the same subscription item page as the cancel action.
Using the ‘gold’ user, log in and navigate to the ‘Accounts’ page. Click on
‘Gold level’ and then click the ‘Update’ link.
The page shows you the last 4 digits of the credit card you used for the subscription.
Enter another test credit card. For instance, if you used
the Visa card initially switch to Mastercard, any other card will do.
Click ‘Update’ and you are navigated back to the subscription item page. All future charges
will use the new credit card.