Free Tools (16) Pricing
0 credits
Add Credits
Dashboard Free Tools

PostGate

5 min read
Updated May 16, 2026
Version 1.2.1
Beginner
Quick Answer

Simple, beautiful content gating for WordPress. Restrict any post or page to logged-in users with a single checkbox.

Simple, beautiful content gating for WordPress. Restrict any post or page to logged-in users with a single checkbox - no membership plugin required.

Overview

Post Gate restricts individual posts and pages to logged-in users. When a non-subscriber visits a gated post or page, they see a customizable message with call-to-action buttons instead of the content. The plugin is intentionally minimal — no user roles, no paywall tiers, no payment integration. It solves one problem well: showing a beautiful "subscribe to read" gate on specific content.

Key design decisions

  • One checkbox — the "Subscribers Only" meta box in the post or page editor is all you need. No complex access rules.
  • Three display modes — inline box, modal popup, or content teaser with fade. Choose what fits your layout.
  • Six color schemes — gradient-based themes (blue, green, purple, red, dark, gold) that look polished out of the box.
  • Theme-aware teaser — the content preview fades out using CSS mask, so it works on dark and light backgrounds without hardcoded colours.
  • Quick Edit — toggle gating directly from the Posts list without opening the editor.
  • GDPR-friendly — no cookies, no tracking, no external requests.

Installation

Method A — WordPress Admin (recommended)

  1. Go to Plugins → Add New Plugin → Upload Plugin
  2. Choose post-gate.zip and click Install Now
  3. Click Activate Plugin

Method B — FTP / SFTP

  1. Unzip post-gate.zip
  2. Upload the post-gate/ folder to /wp-content/plugins/
  3. Activate via Plugins → Installed Plugins
Once activated, go to Settings → Post Gate to configure your message, buttons, and display mode. Then edit any post and check the "Subscribers Only" box to gate it.

Requirements

Requirement Minimum Notes
WordPress 5.5 Tested up to 6.9
PHP 7.4 No PHP extensions required
jQuery Bundled Uses WP's bundled jQuery for the modal close/animation

Settings Page

Access all settings at Settings → Post Gate in your WordPress admin. The settings page is organized into three cards:

  • Message & Content — heading, subheading, main message, benefits list, and login link text
  • Display & Appearance — display mode, color scheme, and teaser word count
  • Buttons — primary and secondary button text and URLs

Changes apply immediately to all gated posts — no need to re-save individual posts.

All Options

All options are stored under the post_gate_options option key.

Key Type Default Description
heading string "Premium Content" Large heading text in the gate box
subheading string "Get instant access…" Subheading below the main heading
message string "Join thousands…" Body paragraph describing why to subscribe
benefits text 4 default items One benefit per line, shown as a bullet list with ✓ prefix
display_mode string "inline" How the gate appears: inline, modal, or teaser
color_scheme string "blue" Gradient theme: blue, green, purple, red, dark, gold
teaser_length number 50 Number of words shown before the gate (teaser mode). 0 = hidden.
button_text string "View Subscription…" Primary CTA button label
button_url string "/subscribe" Primary button link (relative or absolute)
secondary_button_text string "" Secondary button label. Empty = hidden.
secondary_button_url string "/about" Secondary button link
login_text string "Already a member?…" Text for the login link below the buttons. Empty = hidden.

Display Modes

Post Gate offers three ways to present the gate to non-subscribers. Set this under Settings → Post Gate → Display Mode.

Inline Box

The default. Replaces the post content entirely with the styled gate box. The visitor sees the heading, message, benefits, and CTA buttons — no preview of the content.

Content Teaser + Box

Shows the first N words of the post content (configurable via Teaser Length) with a smooth fade-out, followed by the gate box below. This gives visitors a taste of the content before asking them to subscribe. The fade uses a CSS mask, so it works on both light and dark themes without colour mismatches.

Modal Popup

The gate appears as a fullscreen overlay modal 500ms after page load. The modal can be closed with the × button, by clicking outside the modal, or pressing Esc. The post content beneath is fully hidden.

The teaser mode is the most effective for SEO — search engines see the teaser text as real content, so the page has indexable body copy while still gating the full article.

Color Schemes

Six gradient themes ship with Post Gate. Each applies a two-tone gradient to the gate box and automatically adjusts the primary button text colour to match.

Scheme CSS Class Gradient
blue post-gate-blue #667eea → #764ba2
green post-gate-green #11998e → #38ef7d
purple post-gate-purple #8E2DE2 → #4A00E0
red post-gate-red #ee0979 → #ff6a00
dark post-gate-dark #232526 → #414345
gold post-gate-gold #f2994a → #f2c94c

To add a custom colour scheme, add a CSS rule targeting .post-gate-custom .post-gate-box with your gradient, then filter the color_scheme option to "custom".

Gating Posts & Pages

To restrict a post or page, open it in the editor and look for the Post Gate meta box in the sidebar. Check Subscribers Only and save.

The content will now show the gate message to any visitor who is not logged in. Logged-in users (any role) see the full content. This works identically on posts and pages.

Post Gate does not check user roles — any logged-in user can access gated content. If you need role-based restrictions, pair it with a membership plugin that manages user roles.

Programmatic gating

You can also gate a post via code by setting its post meta:

php
update_post_meta( $post_id, '_post_gate_restricted', '1' );

Content Teaser

When Display Mode is set to teaser, Post Gate shows a preview of the post before the gate box. Configure the length at Settings → Post Gate → Teaser Length.

  • 50 words (default) — roughly one short paragraph
  • 0 words — no teaser shown, the gate box appears immediately
  • 100–200 words — good for long-form content where you want to hook the reader

The teaser text fades out with a CSS mask-image gradient, so it works seamlessly on any theme — dark backgrounds, light backgrounds, images, or solid colours. No hardcoded colour values.

Buttons

Post Gate supports two CTA buttons:

  • Primary button — solid white background, colour-matched text. Always shown.
  • Secondary button — transparent background with white border. Hidden by default — leave the text empty to hide it.

Both buttons accept absolute URLs (https://example.com/subscribe) or relative paths (/subscribe). Typical uses: link the primary button to your subscription/payment page, and the secondary to an "about" or "benefits" page.

Quick Edit

Both the Posts and Pages list screens support inline quick-editing of the gate status. Click Quick Edit on any post or page to toggle the "Subscribers Only" checkbox without opening the full editor.

Changes are saved via AJAX — the page doesn't reload. The lock/unlock icon in the Post Gate column updates immediately.

Posts & Pages Column

Post Gate adds a column to both the Posts and Pages list tables showing the gate status of each item:

  • 🔒 Lock icon (purple) — post is gated, only logged-in users can see the content
  • 🔓 Unlock icon (grey) — post is public, visible to everyone

The column is sortable and visible at a glance so you can quickly audit which posts are restricted.

Benefits List

The benefits list appears inside the gate box as a bulleted list with ✓ checkmarks. Enter one benefit per line in the Settings field. Leave the field empty to hide the list entirely.

text — benefits field
Unlimited access to all articles
Weekly newsletter with exclusive content
Ad-free reading experience
Support independent journalism

Each line is output as a <li> inside a <ul class="post-gate-benefits">. The plugin prepends a ✓ to each item automatically.

Hooks & Filters PHP

Post Gate uses WordPress core filter hooks for its content gating. You can interact with it programmatically:

Check if a post is gated

php
$is_gated = get_post_meta( $post_id, '_post_gate_restricted', true );

if ( $is_gated ) {
    // Post is restricted
}

Gate a post programmatically

php
// Gate a post
update_post_meta( $post_id, '_post_gate_restricted', '1' );

// Ungate a post
delete_post_meta( $post_id, '_post_gate_restricted' );

Override options

php — functions.php
// Force dark colour scheme and teaser mode sitewide
add_filter( 'option_post_gate_options', function( $opts ) {
    $opts['color_scheme']  = 'dark';
    $opts['display_mode'] = 'teaser';
    $opts['teaser_length'] = 100;
    return $opts;
} );

Changelog

v1.2.1

  • Added page gating — posts and pages both supported out of the box
  • Added post_gate_post_types filter to extend gating to custom post types
  • Fixed CSS 404 — frontend styles now load from assets/post-gate.css
  • Fixed teaser gradient — uses CSS mask-image for dark/light theme compatibility
  • Fixed modal popup not appearing (function order / script timing issue)
  • Fixed benefits list showing theme bullet styles alongside checkmarks
  • Added Nitroshock branding to settings page (banner, footer card)
  • Styled settings page with card-based layout
  • Fixed all WordPress plugin checker escaping errors (36 issues)
  • Added Esc key to close modal
  • Updated plugin header: Author → Nitroshock, Plugin URI → nitroshock.ai

v1.2.0

  • Added content teaser display mode with configurable word count
  • Added six colour schemes (blue, green, purple, red, dark, gold)
  • Added benefits list with ✓ checkmarks
  • Added secondary button support
  • Added login link below buttons
  • Added modal popup display mode
  • Added animated gradient background on gate box
  • Self-hosted updater

v1.0.0

  • Initial release
  • Single-checkbox post restriction
  • Inline gate message with heading, message, and CTA button
  • Posts list column with lock/unlock icons
  • Quick Edit support
  • Settings page

FAQ

Does it work with custom post types?

Post Gate supports posts and pages by default. To add custom post types, use the post_gate_post_types filter — the meta box, content filter, list column, and quick edit will all extend to those types automatically.

Can I restrict by user role?

No — Post Gate checks is_user_logged_in() only. Any logged-in user can access gated content. For role-based restrictions, use a membership plugin alongside Post Gate.

Will gated content still appear in search results?

Yes — WordPress search queries find gated posts normally. When a visitor clicks through, they see the gate message. In teaser mode, search engines also index the preview text.

Does it work with page builders?

Post Gate filters the_content, so it works with any builder that outputs content through that hook (Gutenberg, Classic Editor, Oxygen, Elementor). Builders that bypass the_content entirely may not trigger the gate.

Does the modal actually hide the content?

Yes. The gate is enforced server-side — the post content is not present in the HTML response at all. Closing or disabling the modal via DevTools does not reveal the content.

Is it GDPR-friendly?

Yes. Post Gate makes zero external requests, sets no cookies, and stores no visitor data. All assets load from your own server.

How do I change the gate box background?

Add a CSS rule in your theme targeting .post-gate-box with your preferred gradient or solid colour. The !important flag may be needed to override the scheme gradient.

Can I gate pages or only posts?

Both. Post Gate supports posts and pages out of the box. For custom post types, use the post_gate_post_types filter in your theme's functions.php:

php — add CPT support
add_filter( 'post_gate_post_types', function( $types ) {
    $types[] = 'my_custom_post_type';
    return $types;
} );

Was this article helpful?