How to display columns based on role?

By adding this piece of code to your theme’s functions.php you will be able to remove any columns based on a user role.

 * Display column based on Role
 * The column name can be found by opening the settings screen of your column
 * and hover your mouse over "Type". In the tooltip you will find the column Name.
 * In this example we will disable the Custom Field column for the 'subscriber' role
function myplugin_filter_hide_column_based_on_role( $column_headings ) {

	// Disable the custom field column with Name 'column-meta' for subscribers
	if ( current_user_can( 'subscriber' ) ) {
		unset( $column_headings[ 'column-meta' ] );

	return $column_headings;
add_filter( "manage_edit-post_columns", "myplugin_filter_hide_column_based_on_role", 201, 1 );
add_filter( "manage_edit-page_columns", "myplugin_filter_hide_column_based_on_role", 201, 1 );