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' );
@hearvox
Copy link

hearvox commented May 1, 2017

Thanks for this gist. Also:
unset( $columns['wpseo-score-readability'] );

And All Pages has 'wpseo-score-readability' and 'wpseo-score-readability':
add_filter ( 'manage_edit-page_columns', 'rkv_remove_columns' );
// add_filter ( 'manage_edit-{$post_type}_columns', 'rkv_remove_columns' );

@pierreville
Copy link

Thank you

@hearvox
Copy link

hearvox commented Nov 3, 2017

And the latest addition:
unset( $columns['wpseo-links'] );

@Mark-Creeten
Copy link

Mark-Creeten commented Feb 14, 2018

unset all those columns for Download manager plugin (https://www.wpdownloadmanager.com/):

//unset all those WPSEO shizzle  columns
function rkv_remove_columns( $columns ) {
	unset( $columns['wpseo-score-readability'] );
	unset( $columns['wpseo-score'] );
	unset( $columns['wpseo-title'] );
	unset( $columns['wpseo-metadesc'] );
	unset( $columns['wpseo-focuskw'] );
	return $columns;
}
add_filter ( 'manage_edit-wpdmpro_columns', 'rkv_remove_columns' );

@phegman
Copy link

phegman commented May 8, 2018

unset( $columns['wpseo-links'] ); can be added as well.

@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