Skip to content

How do I put articles behind a subscription?

KahunaCart can keep pages for paying subscribers in two ways:

  • Lock the whole page. Only subscribers can open it. Everyone else is asked to sign in or told they don't have access. This suits member downloads and private resources.
  • Show a teaser. Everyone can open the article and read the opening paragraphs, and anyone who isn't a subscriber gets a subscribe panel where the rest would be. This is what newspapers and paid newsletters do, and it lets search engines and people sharing links see what the article is about.

Both work through a customer group. A subscription puts its customers in the group while it's live and takes them out when it stops, so access follows the subscription with nothing to update by hand. You need the Subscriptions add-on, and KahunaCart 1.3.8 or later for the teaser.

Set up the group and the subscription

  1. Open KahunaCart → Customer groups and add a group with a code, for example premium.
  2. Open the subscription product that sells access, go to its Plans tab, and open each plan. Pick the group under Customer group while subscribed and save. Do it for every plan, Monthly and Yearly alike, or subscribers on the one you missed stay locked out.

A customer is in the group while their subscription is trialing, active or past due. Someone who cancels keeps access until the end of the period they paid for.

Lock the whole page

Open the page in the admin, go to the Security tab, and pick the group in Access. Or put it in the page's header:

YAML
access:
  site.customer_group.premium: true

Show a teaser

  1. In the page editor, open the Security tab and pick the group in the Paywall field beside Access. Or add paywall: premium to the page's header.
  2. In the article, put a line with just === where the free part ends. Without one, the first two paragraphs are free.
  3. Save, then open the article in a private window. You should see the headline, the opening paragraphs, and a panel with a Subscribe button for each plan that grants the group, with its price, and an Already a subscriber? Sign in link.

A subscriber sees the whole article at the same address. So do you and anyone else who can edit pages, so you can preview it.

The rest of the article is never sent to someone who can't read it. It isn't hidden in the page, and it isn't in your RSS feed or in search results, which show the free part and a link. Write the free part so it works on its own, since it's what search engines, feed readers and shared links show.

When someone subscribes from the panel, their receipt says Continue reading with a link back to the article they were reading.

Give away a few articles a month

To let visitors read a few articles in full before the teaser applies, open KahunaCart → Settings → Accounts and find Articles with a teaser. Set Free Articles to how many a visitor gets, and Count Per to a calendar month or week. It's off while Free Articles is 0.

  • A visitor on a free read sees the whole article with a slim bar above it saying how many they have left.
  • Set Free Reads For to Signed-in customers only if you want people to create a free account before they get free reads. Guests are counted with a cookie, and clearing it gives them fresh reads, while an account's count follows them to any device.
  • Search engines always get the teaser, never a free read.
  • An article that should always be for subscribers can opt out with meter: false in its paywall: header. See the docs for the long form of the header.

If something looks wrong

  • The panel has no Subscribe button. No published plan grants the page's group. Check the plan's Customer group while subscribed, and that the product is published and not sold out. You can also give the button a link of your own, with Subscribe Link in the same settings section or subscribe: in the page's paywall: header.
  • Your RSS feed still prints the start of the whole article. Update the Feed plugin to 1.10.4 or later.
  • Search results quote the paid part of an article. Update YetiSearch Pro to 2.1.2 or later and run a full reindex. Other search plugins read pages their own way, so leave paywalled pages out of their index.
  • The teaser looks out of place in your theme. Your theme can lay it out like its other articles. See How do I make paywalled articles look right in my own theme?

More detail

Was this helpful?

More in Store setup

See all in Store setup