I think the answer is “it depends” — on how flexible and/or “slick” you want the solution to be. The quickest/easiest thing to do would be to create a custom post type (there are tried/true plugins out there that can help establish this) — and then in your theme functions.php (or in a very simple plugin), put in logic that redirects non-logged in users to a page of your choice, if the current post is of that type:
function guest_restrict () {
if ( !is_user_logged_in() && "restricted_post" == get_post_type( get_the_ID() ) )
wp_redirect( 'http://www.foosite.com/some/page' );
}
add_action('template_redirect','guest_restrict');
A “full blown” solution would be to bolt in a membership system (plugin) but that is a much bigger deal.
Related Posts:
- esc_attr() right way and use
- Enforcing password complexity
- Does My Child-Theme Functions.php Need if{die} Security In It? [duplicate]
- How Attackers write script into my php files?
- Remove admin bar for subscribers
- Renaming wp-content folder dynamically
- How do I create a WP user outside of WordPress and auto login?
- Security – Ajax and Nonce use [closed]
- Fix 403 error on WordPress multisite network using subdomains
- Can I write ‘RewriteCond’ using ‘functions.php’?
- Is it unsafe to put php in the /wp-content/uploads directory?
- Sanitize get_query_var() url parameters
- How to create Sub Sub domain Multi User blogs?
- woocommerce and is_user_logged_in() if not redirect to homepage
- When must I use and verify nonce?
- Hiding WordPress Plugin Source Code
- Is this code malidcous
- Admin username and password
- Evaluations of two wordpress security plans against php code injection attack
- WordPress custom login form using Ajax
- How to use my style.css file outside of wordpress subdomain?
- Detect session/cookie variable in wordpress to prevent access to documents
- Is there any risk setting WordPress file permissions and FS method to ‘direct’ on localhost?
- SQL Injection blocked by firewall
- How to prevent XSS alter custom global javascript object & methods in WordPress
- Generating an nonce for Content Security Policy and all scripts – How to make it match/persist for each page load?
- Cannot execute php files in wp-content
- How do I get around “Sorry, this file type is not permitted for security reasons”?
- Security: blocking direct access of php files
- Correct and safe way to include php content in my page
- Password minimum length in personal subscription [closed]
- How to add API security keys into JS of wordpress securely
- Is it best to avoid using $wpdb for security issues?
- Hardening uploads folder in IIS breaks images
- Troll the hackers by redirecting them
- Different Subdomain changes page content
- Security updates to 3.3.2
- how to prevent wordpress admin from logging in via woocommerce my-account page
- malware undetectable by multiple scans
- Decoded malware code [closed]
- How to allow download url redirection only if user logged in WordPress site?
- Automatically generator a WordPress installation on my subdomain
- Updating From Mobile App – Exposing Site to Hacking
- security concerns if using html data-* attribute for l10n?
- How to correctly escape an echo
- How to make Subdomain work for product_tag?
- Reject all malicious URL requests functions.php
- How to serve WordPress folder over subdomain?
- portfolio site – about this site section – is it safe to post some code
- echo cutom css code to WordPress page template file ? is this safe?
- How to secure my php forms
- $.ajax results in 403 forbidden
- Get WordPress username to customize url
- Dynamic Banner Text based on Subdomain
- Site infected by link
- Access WP files on “server 1”, from “server 2” – using wp-load on an external website
- Deny php execution in /wp-includes – using .htaccess in /wp-includes VS root folder
- Retrieve $_POST data to send to javascript without using localize script
- Previewing/Updating some Pages causes “The requested URL was rejected” Error
- How to quickly/easily make an analysis (reverse engineering) of WordPress?
- Masking external links with internal link for member-only
- what to do after instlling cyberpanel on VPS
- What do ++ and *+ mean?
- How to add date range in woocommerce with code
- WordPress remove EXIF Data from specific Thumb
- How Do I Add User Custom Field to REST API Response?
- Should I store my Facebook access tokens?
- How to return output of the new wp gallery block for automatically Link images To Media file
- Can an array be used as a meta_query value?
- Filter get_the_title to remove certain characters?
- Displaying a button on each post
- Store records for a table in wordpress
- WooCommerce Related Products by Attribute
- Image as Sales Badge
- How to Arrange PHP Files to Allow for Multiple Types of Pages?
- Limit Widgets to Sidebar ID’s
- Trouble checking if custom woocommerce checkout field is empty or not
- Add / Update Custom Fields After Select Pictures in Media Window
- How to debug this search & replace strings snippet?
- Remove empty terms from array, sort alphabetically, update back to repeating field
- Call WC_Product get_price()?
- How to remove the space before the ellipsis in excerpt?
- Website completely messes up when logging out
- How do I include an external PHP file in a subdir WordPress install?
- page 1 is not paged
- Drupal is going Symfony. Would WordPress benefit from doing the same? [closed]
- no_rest_route error on custom routes
- HTML Form Question
- How to put the day of the function get_the_modified_date (‘l’, $post_id’) with the first capital letter?
- Set a cookie inside the 404.php theme page
- How to use something like meta_query but for fields?
- Local WordPress from Git repo, where to set document root?
- Sort WooCommerce data with WP-CRON?
- Using Custom Javascript and pHp to send email to myself when a user clicks on an input button but only works on Chrome, IE, and Micorosft Edge
- Can someone help me edit the code for limiting image dimensions
- Access preview settings in php
- custom field meta-box with dropdown/autocomplete
- Removing all my hardcoded URLs with get_site_url()
- Submenu opened problem
- append special url end of my website urls