Docs
Wordpress allows you to create websites, blogs and share content, services and products to users on the web. With content being generated in the form of research reports, courses, online tutorials and more everyday, you can monetize your content by setting up a paywall on your website.
Paywall is a way of gating your site's premium content on a subscription basis.
With Chargebee's plugin for Wordpress, you can implement a paywall on your site and charge users on a subscription basis. It allows you to restrict content based on the subscription on which your customers have signed up.
Ensure that you use these tools and their respective versions to setup the plugin:
Chargebee's plugin creates the following in Wordpress. These are required to setup content restriction on your site:
Products:
Levels:
Once the plugin is installed, Chargebee will create Levels in Wordpress. You can create restriction as follows:
Chargebee's plugin allows you to setup a content restriction mechanism. You can set restrictions for your pages/posts as follows:
Everyone: All viewers can access the content
Select Level: Viewers on a particular level can only view the content. Once this option is selected, you can select a level
As restricted at Category level: Set a level at the Category level, which will apply to all posts/pages in the Category
As per content shortcodes: Restrict content based on the shortcode used on the page or post. Supported shortcodes are listed below:
These shortcodes can be used in your posts/pages to setup restrictions or guide users to sign up:
Action | Shortcode | Description |
---|---|---|
Show content | [cb_content_show level="level_id"] Your content [/cb_content_show] | This content will be shown to users who are on the plan associated with the Level ID mentioned in the shortcode. |
Hide content | [cb_content_hide level="level_id"] Your content [/cb_content_hide] | This content will be hidden for the users who are on the plan associated with Level ID mentioned in the shortcode. |
Checkout subscription | [cb_product_subscribe_hosted class="btn" product_id="plan_id"] Subscribe [/cb_product_subscribe_hosted] | End users can checkout the subscription by clicking the link, which will load Chargebee's in-app checkout. |
Manage subscription | [cb_account_portal class="btn"] Manage Subscription [/cb_account_portal] | End users can manage their subscription by clicking the link, which will load Chargebee's self-serve portal. |
Display subscription | [cb_display_subscription] | End users can view their subscription details. |
Show content(guest users) | [cb_not_logged_in] Your content [/cb_not_logged_in] | This content will be shown to users who have not logged in to your website. |
Show content(paid) | [cb_paid_subscription] Your content [/cb_paid_subscription] | This content will be shown to users on paid plans. |
Show content(free) | [cb_free_subscription] Your content [/cb_free_subscription] | This content will be shown to users on free plans. |
Replace "Product ID" in the Product Subscribe shortcode with Product ID of the plan which needs to be represented. Product ID of a plan is similar to the Plan ID in your Chargebee site.
Make sure the "level_id" placeholder is replaced with an actual level_id when using shortcodes. If "level_id" is not mentioned for [cb_content_show] shortcode, the content will be shown to all users. Similarly, if "level_id" is not mentioned for [cb_content_hide] shortcode, content will be hidden for all users.
Addons will not be synced from Chargebee to Wordpress.
Single page Checkout is not supported. In-app Checkout will load when your customer is making a purchase.
Pricing table is not supported. However, if you would like to display multiple plans on a single page, you can use the Subscribe shortcode for each plan. This way, your customers can checkout directly from one page.
Multi sites in Wordpress is not supported.
1) How do I migrate to the new version of the Wordpress plugin by Chargebee?
You can un-install the plugin and install the new version. On contacting Support, we will share the latest file for you to install. Also, refer to the new set of shortcodes.
2) How to assign a default plan for anyone who signs up?
To assign a free plan as the default subscription for all new signups, go to your Wordpress site > Chargebee > Settings > General and choose an option from Default Membership Product dropdown. Note that only "free plans" i.e., zero-dollar plans can be assigned as a default plan for new sign-ups.
3) How to change the Content Restriction Message?
You can set a custom message for guests or free plan users accessing gated content. Navigate to your Wordpress site > Chargebee > Settings > General and set a custom restriction message in the text box provided.
4) What are the deprecated shortcodes?
These shortcodes are deprecated:
5) Plans from Chargebee are not imported, what should I do?
In case the plans from Chargebee are not imported, try updating Plan ID in your Chargebee site and sync again.
6) If the customer's subscription is changed in my Chargebee site, will it reflect on the Wordpress site?
Yes, it would reflect in your Wordpress site. The customer would now be shown content according to their new plan.