Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save chuckreynolds/6171160 to your computer and use it in GitHub Desktop.
Save chuckreynolds/6171160 to your computer and use it in GitHub Desktop.
remove WordPress SEO columns from admin post tables
<?php
function rkv_remove_columns( $columns ) {
// remove the Yoast SEO columns
unset( $columns['wpseo-score'] );
unset( $columns['wpseo-title'] );
unset( $columns['wpseo-metadesc'] );
unset( $columns['wpseo-focuskw'] );
return $columns;
}
add_filter ( 'manage_edit-post_columns', 'rkv_remove_columns' );
@krystianjj
Copy link

works great, but I search some similar functionality.
Hidden all languages and display only one column with flag instead "check", because now I have 11 languages = 11 columns

@krystianjj
Copy link

krystianjj commented Aug 2, 2018

I resolve my problem by remove all columns with languages and I add custom column with current lang.

Maybe can help someone:

function polylang_extra_columns_head($defaults) {
	$defaults['lang'] = 'Lang';
	return $defaults;
}

function polylang_extra_columns_content($column_name, $post_ID) {
	if ($column_name == 'lang') {
		echo strtoupper( pll_get_post_language($post_ID) );
	}
}

add_filter('manage_posts_columns', 'polylang_extra_columns_head');
add_action('manage_posts_custom_column', 'polylang_extra_columns_content', 10, 2);

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment