Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
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

This comment has been minimized.

Copy link

@hearvox 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

This comment has been minimized.

Copy link

@pierreville pierreville commented May 4, 2017

Thank you

@hearvox

This comment has been minimized.

Copy link

@hearvox hearvox commented Nov 3, 2017

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

@Mark-Creeten

This comment has been minimized.

Copy link

@Mark-Creeten 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

This comment has been minimized.

Copy link

@phegman phegman commented May 8, 2018

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

@krystianjj

This comment has been minimized.

Copy link

@krystianjj krystianjj commented Aug 2, 2018

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

This comment has been minimized.

Copy link

@krystianjj 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