Support » Plugins » Editing Comment Meta in edit comment admin panel

  • Hi,

    Have spent the last few days trawling the web trying to find a solution for this. I really hope someone can help.

    I have extra comment fields for comments ($myorg for example) and i capture and output this OK.

    [if anyone wants to know how I did this:

    Now I need to add the ability to edit the custom comment meta fields in the Edit Comment admin pannel.

    I think that I need to use the manage_comments_custom_column action hook but can not seem to find any examples or any documentation on the codex.

    I have seen a couple of people asking for a similar solution but no useful replys.

    This will be the first time I have tried to edit a write panel in wordpress so please keep in my my limited experince.

    Thanks for any help on this. Would be so much appreciated!


Viewing 9 replies - 1 through 9 (of 9 total)
  • Have a look at the information on manage_posts_custom_column and manage_posts_column, the same procedure (with minor naming differences) should still apply.

    Assumption on my part, but i’d expect it to behave the same as the manage post column functions.

    Post back if you still get stuck.. 😉

    Thanks for the reply T31os,

    Hit a bit of a brick wall on this.

    I tried to start by just getting the value of the commentmeta $myorg into a new column in the edit comments panel but struggling to get it to work.

    I would have thought this should work?

    function EditCommentsColumnsHeader($columns) {
    	$columns['myorg'] = __('Org');
    	return $columns;
    add_filter( 'manage_comments_column', 'EditCommentsColumnsHeader' );
    function EditCommentsColumnsRo($columnTitle, $comment_ID){
    	if($columnTitle == 'Org'){
    		echo $myorg;
    add_filter( 'manage_comments_custom_column', 'EditCommentsColumnsRow', 10, 2 );

    Am I on the right track?


    Looks about right, though there’s a small error in your function name here.

    function EditCommentsColumnsRo($columnTitle

    Missing the w on the end of the function name.

    Hi ,

    function EditCommentsColumnsHeader($columns) {
    $columns[‘myorg’] = __(‘Org’);
    return $columns;

    add_filter( ‘manage_comments_column’, ‘EditCommentsColumnsHeader’ );

    function EditCommentsColumnsRow($columnTitle, $comment_ID){
    if($columnTitle == ‘Org’){
    echo $myorg;

    add_filter( ‘manage_comments_custom_column’, ‘EditCommentsColumnsRow’, 10, 2 );

    this code is not working.

    i want to add custom fields on Comment management screen of admin panel and also want to add more fields on edit comment screen after Editor. but unfortunately i cant found any plugin or any action in word press which allow me to do this.

    any one know how it possible?

    many thanks

    the problem is that there isn’t a filter for managing comments column.
    There is a action hook in the name of “manage_comments_custom_column”
    but there isn’t a filter hook to go with, like “manage_comments_columns”
    I’ve looked everywhere for that filter hook… and nothing.

    What can be the solution?


    I too would like a solution to this. Not found it yet.



    function comment_meta_row_action( $a ) {
    	global $comment;
    	echo '<div class="comment-meta">';
    	echo get_comment_meta( $comment->comment_ID, 'town', true );
    	echo '</div>';
    	return $a;
    add_filter( 'comment_row_actions', 'comment_meta_row_action', 11, 1 );

    Akismet “User X marked this as spam” message is priority 10, so I’ve set this function to 11.

    I’ve to admit that I’m not sure exactly what $a does here, but it seems to be essential for a loop that WordPress uses when writing out rows in the comment details.

    @adriantoll – that code will add the comment meta data to the main comments list page. I was looking to be able to add the comment meta data to the edit comment form to be able to make the comment meta editable… but last I don’t think this is currently possible.



    Ah, yes – apologies for the confusion – this post came up during a search that I was doing for a way to display rather than edit. If there’s no hook I guess the only way would be to write a plugin which enabled you to manage them from a Settings or Tools page – but I’d hope that a hook will be added sometime soon to make this possible in the default comments interface because it seems like a reasonable request to make data stored in commentsmeta editable.

Viewing 9 replies - 1 through 9 (of 9 total)
  • The topic ‘Editing Comment Meta in edit comment admin panel’ is closed to new replies.