0

I would like to remove "Comments" and "Author" columns from the list of pages, and add a couple of my own "Permalink" etc.

Is this possible? Is there an appropriate hook I could use?

2 Answers 2

1

I think manage_edit-post_type_columns and manage_posts_custom_column is what you're looking for:

1

To add, here's some (cleaned) example code from a project I'm working on

add_filter( 'manage_post_type_posts_columns', 'my_columns_init' );
add_action( 'manage_post_type_posts_custom_column', 'my_columns_render', 10, 2 );

function my_columns_init( $defaults ) {
    $defaults['col_name'] = 'Column Name';

    return $defaults;
function my_columns_render( $column_name, $post_id ) {
    if( $column_name == 'col_name' ) {
        //your output here
    }
}

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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