Choosing a restriction method

The Restriction Method setting decides where Leaky Paywall checks whether a reader can see a post: on your server before the page is sent, or in the reader's browser after the page loads. You'll find it at Leaky Paywall > Settings > Restrictions.

This setting is in Leaky Paywall 5.3.0 and later. Earlier versions had a single Alternative Restriction Handling checkbox, which is the same as the JavaScript method below.

The three methods

Automatic (recommended)

Posts that no logged-out visitor can ever read are restricted on the server, so their full text never reaches the page. These are posts limited to paid levels, and posts whose restriction rule allows 0 free views. Metered posts, the ones visitors can read a few of for free, are checked in the browser, so your free article meter keeps working when your host or a plugin caches pages.

JavaScript

Every restricted post is checked in the browser. This works with page caching, but the full text of every post is in the page source, where anyone who views the source can read it.

Server

Every restricted post is checked on the server, so its full text never reaches the page. Only use it if your pages are not cached. A cached page can show the paywall to a subscriber, or the full post to a visitor who should see the paywall.

Which one to choose

  • Automatic suits most sites. It keeps your paid-only posts out of the page source and works with page caching.
  • Server suits a site with no page caching that wants no restricted text in the page source at all, metered posts included.
  • JavaScript is the older approach. If you're on it and everything works, you can stay, but switching to Automatic protects your paid-only posts.

Updating doesn't change your method

If you had Alternative Restriction Handling checked, you're on JavaScript. If it was unchecked, you're on Server. New installs start on Automatic. To switch:

  1. Go to Leaky Paywall > Settings > Restrictions.
  2. Choose a method under Restriction Method and click Save Settings.
  3. Clear your page cache, so visitors aren't served pages built under the old method.
  4. Open a restricted post in a private browser window to check what visitors see.

The teaser now comes from Lead In Elements

The teaser is the part of a post shown above the subscribe message. Every method now builds it the same way: the first few blocks of the post, such as paragraphs, images and headings, with their formatting. How many is set by Lead In Elements on the same screen. Set it to 0 to show only the subscribe message.

If you use the Server method, your teaser will change when you update. It used to be the first Custom Excerpt Length characters of the post as plain text, and that setting has been removed. After updating, look at a restricted post and adjust Lead In Elements if the teaser is now longer or shorter than you want.

Page caching

  • Automatic and JavaScript work with page caching. Server doesn't.
  • With Automatic, a paid-only post shows every logged-out visitor the same paywall, so the page can be cached safely. Subscribers still need pages that aren't cached, so your cache must skip logged-in readers. Most hosts and caching plugins already do this. See Caching with Leaky Paywall for what to exclude.
  • Metered posts are checked in the browser with Automatic and JavaScript. That check needs to know where your post content is on the page, set by JavaScript Restrictions Post Container and JavaScript Restrictions Page Container. The default, article .entry-content, works with most themes. If visitors see a full post with no paywall, your theme probably uses a different container. The caching article above explains how to find it.

List Builder

List Builder's signup and upgrade panels work with every method. On a post only paid levels can read, logged-out visitors get the upgrade panel instead of the free signup, since a free account wouldn't unlock that post.

Search engines and AI crawlers

A post restricted on the server shows search engines and AI crawlers only its teaser, the same as a visitor without access. To let search engines index the full text, turn on Search Engine Bot Bypass on the same screen. AI crawlers are not let through.

Posts checked in the browser are different: crawlers can read their full text in the page source. That's every restricted post with JavaScript, and metered posts with Automatic.

For developers

  • leaky_paywall_restriction_mode filters the site's setting: automatic, js or server.
  • leaky_paywall_restriction_method filters the method used for one post (server or js), and receives the post ID and the site's mode.
  • leaky_paywall_post_is_hard_restricted filters whether Automatic treats a post as one no logged-out visitor can read.
  • leaky_paywall_js_restriction_lead_in_elements filters the Lead In Elements count. It now applies to every method.
  • leaky_paywall_nag_excerpt now receives the teaser as HTML instead of plain text.

Still need help? Contact Us Contact Us