Comment Visibility Rules
Comment Visibility Rules
The Private Comments plugin enforces a strict privacy policy to ensure that discussions remain confidential. Visibility is determined by a user's relationship to the specific comment or the post on which the comment was made.
Permitted Roles and Access Levels
By default, only three specific types of users can view a comment:
- Comment Author: The user who originally wrote and submitted the comment. They can always see their own contributions.
- Post Author: The owner of the post or page where the comment resides. This allows authors to moderate and respond to feedback on their own content.
- Site Administrators: Users with administrative privileges across the WordPress installation. They have global visibility to all comments for moderation and oversight purposes.
Visibility Matrix
The following table illustrates whether a user can see a comment based on their role:
| User Type | Visibility | | :--- | :--- | | Comment Author | Allowed | | Post Author | Allowed | | Site Administrator | Allowed | | Other Logged-in Users | Restricted | | Logged-out Guests | Restricted |
Public Interface Behavior
Once activated, the plugin filters the comment stream across the entire front-end of the website.
- Comment Count: The public comment count (e.g., "5 Comments") will reflect only the number of comments the current viewer is authorized to see. For a general visitor, this count may appear as zero, even if private discussions are occurring.
- Comment List: Only authorized comments are passed to the theme's comment template. There is no additional configuration required; the plugin hooks into standard WordPress comment queries automatically.
Usage Example: Testing Visibility
To verify that the visibility rules are functioning correctly on your site, you can perform the following test:
- As an Admin: Post a comment on a post. You will see the comment.
- As the Post Author: Log in as the user who created that specific post. You will see the admin's comment.
- As a Subscriber (Non-Author): Log in as a standard user who did not write the comment or the post. The comment section will appear empty.
- As a Guest: Log out and view the post. The comment section will appear empty.
Note on Global Settings
These rules apply globally to all post types (Posts, Pages, and Custom Post Types) that have comments enabled. There is no per-post toggle; once the plugin is active, all comments on the site transition to this private visibility model.