Disable comments to guests #4

tomer opened this Issue Aug 8, 2012 · 2 comments


None yet

2 participants

tomer commented Aug 8, 2012

As we plan to use OneMozilla theme on our community site, there is something that I wish to change that might interest others. Instead of disabling comments, I wish to disable comments to people who are not logged in to WordPress, which includes search engines and casual visitors while people who have account on the site includes authors as well as active contributors who can suggest changes on the comments.

In case this request would be accepted, we need to add a theme option on functions.php and a condition such as if (not comments_allowed_to_guests and user_logged_in) then show_comments on comments.php.


@tomer: If I understand correctly, you want comments to not even be readable by anonymous users? You can easily set WordPress to require a user to authenticate in order to post comments, but those comments are still visible to anyone who visits. This template change would hide all comments from anyone who is not logged in.

If that is indeed what you want then we shouldn't do it in the master theme since it would break any other blogs using One Mozilla, but you could easily do it in a child theme. Or we could quite easily implement it as a theme option if you think it's not a unique use case (if anyone else might want to hide comments from non-members).

tomer commented Aug 9, 2012

Instead of disabling comments or making it read only to guests, I was thinking on making it visible to registered users only, as a way for team members to discuss on each page and suggest changes. Guests won't be able to add comments as well as seeing them, and we can restrict registration to small group of team members. It can be easily added to a child theme, but I think it useful enough to be implemented on the base theme as well.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment