Troubleshooting & Support
Troubleshooting
If you encounter issues while using the Private Comments plugin, please review the following common scenarios and solutions.
1. Comments are still visible to the public
If users who are not the comment author, post author, or an administrator can still see comments, check the following:
- Caching Plugins: Most WordPress sites use caching (e.g., WP Rocket, W3 Total Cache, or Cloudflare). If a page was cached before the plugin was activated, the old "public" version of the comments might still be served. Clear all site and server-level caches to ensure the privacy logic is applied.
- Custom Theme Templates: This plugin hooks into the standard WordPress
comments_clausesandthe_commentsfilters. If your theme uses a custom SQL query or a non-standard method to display comments that bypasses these filters, the plugin may not be able to intercept the data.
2. Post Authors cannot see comments
Post authors should be able to see all comments on their own posts. If they cannot:
- Role Permissions: Ensure the user is correctly assigned as the "Author" of that specific post.
- Plugin Conflicts: Some security or role-management plugins (like User Role Editor) may have strict restrictions that override comment visibility. Try disabling these temporarily to identify if there is a conflict.
3. Logged-out users see "0 comments" but the count is wrong
The plugin hides the content of the comments, but depending on your theme, the "Comment Count" (e.g., "5 Comments") might still show the total number. To fix this, you may need to add a filter to your theme's functions.php to adjust the count for public users:
// Example: Adjusting comment count for public users
add_filter('get_comments_number', function($count, $post_id) {
if (!is_admin() && !current_user_can('moderate_comments')) {
// Logic to return 0 or a filtered count
}
return $count;
}, 10, 2);
4. Conflict Testing
If the plugin is not working as expected, follow these steps to isolate the cause:
- Switch to a Default Theme: Temporarily switch to a default WordPress theme (like Twenty Twenty-Four). If the plugin works there, the issue lies with your theme's comment implementation.
- Deactivate Other Plugins: Disable all other plugins. If the issue is resolved, reactivate them one by one to find the conflicting software.
Support
If you have gone through the troubleshooting steps and still require assistance, or if you wish to request a feature, please use the following channels:
Bug Reports & Feature Requests
Please submit an issue on the GitHub Repository Issues page. When reporting a bug, please include:
- Your WordPress version.
- Your current Theme name.
- A list of active caching or security plugins.
- Steps to reproduce the issue.
Contributing
If you are a developer and wish to contribute a fix or a new feature:
- Fork the repository.
- Create a new branch for your feature or fix.
- Submit a Pull Request with a detailed description of your changes.