Web Hosting Geeks | Web Hosting Experts
Need help? Call us 1(866)TOP-HOST

14611 reviews 1734 hosting providers

Questions & Answers

wordpress Only allow Admin users to post comments

Jun 1, 2012 by Alpha2
hi all

I have a wordpress blog and I want to allow only Administrator users, to post comments into my blog. I want the subscribers to be able to read the comments but not to be able to make any responses.
I tried a few role management plugins such as ‘Role Manager’ and ‘Role Scoper’, but none of what I tried worked like I want it to.
Does anyone know how I can achieve this? Please  help.

Thanks

1 Answer

0 votes
Jun 1, 2012 by randy999
If  the comment form is being called  by your theme in comments.php. Then you can just change the calling function so that only admin users can make comments. You can use the following;
<?php
if(is_user_logged_in() && current_user_can('administrator')) {
  comment_form();
}
?>