Title: POST COMMENTS
Last modified: July 9, 2018

---

# POST COMMENTS

 *  Resolved [weric](https://wordpress.org/support/users/weric/)
 * (@weric)
 * [7 years, 11 months ago](https://wordpress.org/support/topic/post-comments-8/)
 * Hello,
 * I would need to ban a specific user role (ex: ROLE1) from commenting but still
   let him see all existing comments on a blog post. How can I do that with a PHP
   script ?

Viewing 5 replies - 1 through 5 (of 5 total)

 *  [Kartik Shukla](https://wordpress.org/support/users/kartiks16/)
 * (@kartiks16)
 * [7 years, 11 months ago](https://wordpress.org/support/topic/post-comments-8/#post-10475969)
 * Hello,
 * This can be achieved with the help of Plugin.
 * Please refer below plugins if that can help.
 * [https://codecanyon.net/item/groups-restrict-comments-pro/6508819](https://codecanyon.net/item/groups-restrict-comments-pro/6508819)
 * [https://wordpress.org/plugins/advanced-access-manager/](https://wordpress.org/plugins/advanced-access-manager/)
 * [https://wordpress.org/plugins/capability-manager-enhanced/](https://wordpress.org/plugins/capability-manager-enhanced/)
 * Thanks.
 *  Thread Starter [weric](https://wordpress.org/support/users/weric/)
 * (@weric)
 * [7 years, 11 months ago](https://wordpress.org/support/topic/post-comments-8/#post-10476176)
 * thanks for the links. I discovered insteresting plugins. Unfortunately this not
   exactly what I need to achieve.
 *  Thread Starter [weric](https://wordpress.org/support/users/weric/)
 * (@weric)
 * [7 years, 11 months ago](https://wordpress.org/support/topic/post-comments-8/#post-10476217)
 * I already have the first part of the php script :
 * if (current_user_can( ‘role1’) && has_category( ‘abc))
    ) { if ( ( comments_open()
   || get_comments_number() ) && ‘on’ == et_get_option( ‘divi_show_postcomments’,‘
   on’ ) ) { comments_template( ”, true ); } }
 * The second and missing part is
    ELSE I would like to show the existing comments
   for the current post but not the comment form to add a new comment.
 * Any help appreciated, thanks in advance
 *  [Kartik Shukla](https://wordpress.org/support/users/kartiks16/)
 * (@kartiks16)
 * [7 years, 11 months ago](https://wordpress.org/support/topic/post-comments-8/#post-10478873)
 * Hello,
 * You can try using [get_comments() ](https://codex.wordpress.org/Function_Reference/get_comments)
 * Further, you can also refer the link which can help you with code.
 * [https://wordpress.stackexchange.com/questions/81690/display-comments-on-a-comment-page-without-form](https://wordpress.stackexchange.com/questions/81690/display-comments-on-a-comment-page-without-form)
 * Let me know if this solves your issue.
 * Thanks.
 *  Thread Starter [weric](https://wordpress.org/support/users/weric/)
 * (@weric)
 * [7 years, 11 months ago](https://wordpress.org/support/topic/post-comments-8/#post-10479040)
 * Works fine.
    Many thanks for your help

Viewing 5 replies - 1 through 5 (of 5 total)

The topic ‘POST COMMENTS’ is closed to new replies.

 * In: [Fixing WordPress](https://wordpress.org/support/forum/how-to-and-troubleshooting/)
 * 5 replies
 * 2 participants
 * Last reply from: [weric](https://wordpress.org/support/users/weric/)
 * Last activity: [7 years, 11 months ago](https://wordpress.org/support/topic/post-comments-8/#post-10479040)
 * Status: resolved

## Topics

### Topics with no replies

### Non-support topics

### Resolved topics

### Unresolved topics

### All topics
