Skip to content

Inline content gating with shortcodes

Gate a section, not a whole page — keep the intro public and lock just the premium block with a shortcode.

  • Wrap any block
  • Conditions inline
  • Public + gated on one page
No credit card required
FreeRestrict & gate

Sometimes you want a public intro and a gated section on the same page. The [arraysubs_restrict] shortcode wraps just the premium block, gating it by status, product, role, lifetime spend, or feature, with a custom message or redirect for non-members. This recipe gates inline content.

What you get
  • Gate a single section, leaving the rest public.
  • Combine conditions inline (AND/OR).
  • Show a custom message or redirect non-members.
  • Restricted content is omitted from page source entirely.
Copy these settings

The exact configuration

Enter these values and you have the setup live. Every field maps to a real ArraySubs setting.

SettingValue
ShortcodeAny page/post/widget[arraysubs_restrict] … [/arraysubs_restrict]
Key attributesShortcodestatus · products · roles · lifetime_spent · feature (Pro)
Logic + fallbackShortcodecondition=and|or · message · redirect · login_required
Admin bypassShortcodeshow_to_admins (default true)
Best for

When to use this setup

Teaser + premium on one page
Sales pages with member-only blocks
Granular, in-content gating
Set up

Set it up in 2 steps

A step-by-step guide drawn from the ArraySubs user manual. Open the linked page for the full walkthrough and screenshots.

  1. Wrap the premium block

    In the editor, wrap the gated content in [arraysubs_restrict status="active"] … [/arraysubs_restrict].

    Content-Gating Shortcodes
  2. Tune conditions and fallback

    Add attributes (products, roles, lifetime_spent, feature) and set condition (and/or), plus a message or redirect for non-members.

    Content-Gating Shortcodes
From the manual

This recipe is built from these ArraySubs user-manual guides:

Good to know

Notes & edge cases

Restricted content is omitted from the page source entirely (not just CSS-hidden).
If both message and redirect are set, redirect wins on the frontend.
Feature attributes require Pro + Feature Manager; admins see content by default (show_to_admins).
Built with

Modules behind this recipe

The ArraySubs modules this setup relies on.

Free + Pro

Shortcodes

Display login/logout links, personalized user data, gated content, and Pro store credit forms anywhere.

Free + Pro

Member Access

Control who can see, download, and purchase content using flexible rules tied to subscriptions and roles.

Pro

Feature Manager

Define product entitlements, limits, and capabilities so customers know exactly what each subscription includes. Pro only.

FAQ

Questions, answered

Yes. The shortcode supports products, variations, purchased, lifetime_spent, roles, and (Pro) feature conditions, combined with and/or.

Yes. Restricted content is omitted from the rendered page source entirely, not hidden with CSS.
Paid Pro plans

Unlock the complete Pro stack

Start on the free-forever core today, then choose a paid Pro plan when you need the advanced Pro feature set.

No credit card required · Annual and lifetime options available