You are not missing anything. With WordPress, you don’t have control on visitors (anonymous user). The only control you have with is_user_logged_in()
to check user logged in or not. You can prevent posts from visitors.
Also, you can create a cookie or local storage based function (for control how many posts they visit) and integrate this function with is_user_logged_in()
.
Related Posts:
- Roles for Custom Post Types
- Why “Mine” is the default view when adding ‘capability_type’ in register_post_type
- Remove Custom Capability
- Capabilities and Custom Post Types
- Allow member to have access to custom post type only. Permission to only edit their own posts
- Possible to hide Custom Post Type UI/Menu from specific User Roles?
- With Rest V2 (WP4.7) how does one restrict certain RESTFUL verbs?
- Custom post type role permissions won’t let me read
- How to assign specific users the capability to edit specific pages / posts / custom post types
- Allow user to Edit Posts but not Add New?
- Defining capabilities for custom post type
- Confusion with adding meta capabilities to a role after registering a Custom Post Type with corresponding ‘capability_type’ parameter
- Customize users’ capabilities to change a custom post’s post status
- Notice: map_meta_cap was called incorrectly
- Create user role restricted to specific CPT
- How to set individual capabilities on a taxonomy? Or how to re-register an existing taxonomy?
- Custom Post Types – Capability Type
- Custom Post Type Capabilities — Enable Edit, Disable Create and Delete
- Add Capabilities to Custom Post Type after it has been created [duplicate]
- How to not allow custom roles to edit published custom post types?
- When you create a custom post type, does that also create capabilities for editing/deleting that post type automatically?
- Allow Author role to publish one post type and not another
- How do I code access to the built-in UI of a CPT when it’s placed as submenu of another CPT that is protected by role?
- WordPress allow access only one custom post type “xyz” to custom user role but need to hide all admin panels
- Custom role capabilities to administrator not taking effect (no plugin)
- Prevent author role from editing all posts in custom post type?
- Allow Users Access to Custom Post Type Only
- How to allow “Add New” capability of CPT when links to its UI are placed as a submenu?
- Custom Role can’t trash Custom Post Type
- Role Capabilities: Add New Ones?
- Custom post type capabilities require “create_posts” to access the edit posts list page
- Registration and Custom Post Types – How to synchronize information?
- Notice: Undefined property: stdClass::$delete_posts with custom post type
- Add custom capabilities to existing custom post type
- allow edit of custom post type but not regular posts?
- Allow Administrator role access to custom capabilities [duplicate]
- Why is my Custom Post Type not showing up after adding capabilities?
- Cannot attach media when capabilities added to custom post type
- Custom Post Type Tag Capabilities Not Working
- current_user_can() return FALSE but debugging says TRUE
- Role capability delete multiple post type posts doesn’t work
- Custom Post Type Capabilities
- map_meta_cap woes
- Custom post type: check permissions and validate nonce
- can’t see custom post content filtered under “mine” filter in admin panel
- Define new user capability for custom post types?
- Adding user capabilities for a custom taxonomy of a custom post type for a custom user
- How to set individual capability of post type in individual category
- Restrict Access to Posts based on Custom User and Post Meta Data
- Giving permission to anyone (non-users as well) with a password to edit a post, possible?
- delete_published_posts does not work
- Permit users with author role to edit a custom post type
- Able to edit custom post, but unable to create new custom post when within submenu. What capability is missing?
- Disable user from updating certain posts
- “Submit for review” for updates on existing posts
- Access to CPT but not to ‘post’ post type
- Allow add new post access to custom post but not wp post for some role
- How to restrict author to only access one custom post type ?
- Cannot Create new Post within Custom Post Type
- Allow user to only access custom post type
- Custom post type submenu capabilities – custom plugin
- re-register custom post type with custom capabilities
- Filtering results for post_type tells me I don’t have permission
- Conflict between Capabilities and Menu Visibility with Custom Post Types
- Role capabilities issue
- WordPress: Custom User Role cannot access Custom Post Type | “Sorry, you are not allowed to access this page”
- Select other roles as custom post authors
- Capabilities not working with custom post type
- How to handle this specific case of custom post type?
- get_delete_post_link() only works for administrator, even if other user has exactly the same permissions
- Custom capabilities not reflecting on admin panel
- Admin: Get all user for Custom Role
- Preventing role reading others posts
- Custom Post Type not working with Capabilities
- Roles and Capabilities in Custom Post Types
- custom post type capabilities – needs to be VERY secure
- How to fix the Post Preview Button (CPT & map_meta_cap)
- Restrict Custom Post Type per role in Dashboard
- Restrict access to custom post type based on its taxonomy terms
- Restrict access only of custom post type with standard capabilities to edit_post
- CPT requires manage_options and edit_posts for some reason
- Allowing custom role user to edit post assigned to them but don’t let them create new custom type post
- Can’t see post status drop down for custom post type
- Front-end submitted post is published with admin ID as author
- WooThemes – Vendors / Bookings – Allow Vendors to manage resources
- How to create new permission for custom post types for doing specific tasks
- How can I remove “Add new” button on custom post type
- Capabilities and mapping required for a role to be able to edit other’s posts of a custom type, BUT only be able to edit their own blog posts
- Weird capabilities / roles behavior
- Prevent author role from editing others posts
- creating different edit screens for different roles
- Capability to edit own post, but not create new one
- What would prevent a custom role from viewing posts (both standard and custom)?
- Capability to read user’s own draft post of CPT
- Custom role, capabilities, and post type: preview button wrecks things
- Custom post type & role issues
- How to add post of custom type to a category with custom type capabilities
- Read-Only custom post type
- Restrict editing of a custom post type based on status and user capabilities
- Understanding capabilities parameter in register_post_type()