I have a website running shapely as my theme, and I am trying to allow only logged in members to see comments on a post, and restrict anyone but administrators from commenting. I would like comments to appear closed to everyone but administrators while previous comments are still visible to members.

In order to do this I just need to know how to assign a "closed for comments" value to a post, preferably from inside the comments.php file. Basically I would like to change all posts so the function: comments_open() returns false, via code.

is there any easy way to do this?

  • 1
    Note that if you just remove the comment form that doesn't mean comments can't be submitted, WP still listens for the comments form submission – Tom J Nowell Jun 10 '19 at 18:30
  • does that still happen if you disable comments from the admin menu? – Mikestanator Jun 10 '19 at 18:36

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.