WordPress Development Stack Exchange is a question and answer site for WordPress developers and administrators. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I am making a custom Wordpress site where School students logged in and add their posts. I am giving them rights to use wp-admin panel with little customization and modification.

QUESTION: "How can logged in user be able to see comments of his own post only in edit comment admin panel"

please suggest me some solution i am in need for the same

Thanks in advance

share|improve this question
up vote 0 down vote accepted

i had been looking for the code where logged in users will be able to see post of his own only i have managed to make simple function that we can use for the same the function snippet has to be included in functions .php file in the theme folder which you are using

function my_plugin_get_comment_list_by_user($clauses) 


if (is_admin()) 


  global $user_ID, $wpdb;

  $clauses['join'] = ", wp_posts";

  $clauses['where'] .= " AND wp_posts.post_author = ".$user_ID." AND wp_comments.comment_post_ID = wp_posts.ID";


 return $clauses;


// Ensure that editors and admins can moderate all comments



 add_filter('comments_clauses', 'my_plugin_get_comment_list_by_user');


Thanks NIkhil Joshi

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.