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.
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.
post-gate.zip and click Install Nowpost-gate.zippost-gate/ folder to /wp-content/plugins/| 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 |
Access all settings at Settings → Post Gate in your WordPress admin. The settings page is organized into three cards:
Changes apply immediately to all gated posts — no need to re-save individual posts.
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. |
Post Gate offers three ways to present the gate to non-subscribers. Set this under Settings → Post Gate → Display Mode.
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.
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.
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.
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".
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.
You can also gate a post via code by setting its post meta:
update_post_meta( $post_id, '_post_gate_restricted', '1' );
Below the buttons, Post Gate shows a login link that takes existing subscribers to wp-login.php with a redirect back to the current post. The link text is configurable under Login Link Text in Settings. Leave the field empty to hide the link entirely.
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.
Post Gate adds a column to both the Posts and Pages list tables showing the gate status of each item:
The column is sortable and visible at a glance so you can quickly audit which posts are restricted.
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.
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.
When display_mode is set to modal, the gate renders as a fullscreen overlay. The modal is injected in wp_footer and shown via jQuery 500ms after page load.
Post Gate uses WordPress core filter hooks for its content gating. You can interact with it programmatically:
$is_gated = get_post_meta( $post_id, '_post_gate_restricted', true ); if ( $is_gated ) { // Post is restricted }
// Gate a post update_post_meta( $post_id, '_post_gate_restricted', '1' ); // Ungate a post delete_post_meta( $post_id, '_post_gate_restricted' );
// 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; } );
post_gate_post_types filter to extend gating to custom post typesassets/post-gate.cssPost 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.
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.
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.
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.
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.
Yes. Post Gate makes zero external requests, sets no cookies, and stores no visitor data. All assets load from your own server.
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.
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:
add_filter( 'post_gate_post_types', function( $types ) { $types[] = 'my_custom_post_type'; return $types; } );