WordPress: Add an extra column in the All Users admin page

WordPress development involves extending information were possible to suite business needs. For those that need to add an extra column in the Users table, heres how to do it in your plugin or functions.php file.

function all_columns( $columns ){
   $columns['cool_column'] = 'Column Header';
   return $columns;
}

function custom_column_content( $content, $column, $user_id ){
   if ( $column === 'cool_column' ) {
      $content = "custom data";
      return $content;
   }
}

add_filter( 'manage_users_columns', 'all_columns' );
add_filter( 'manage_users_custom_column', 'custom_column_content', 10, 3 );

Leave a Reply

Your email address will not be published. Required fields are marked *