-
-
Save chuckreynolds/6171160 to your computer and use it in GitHub Desktop.
remove WordPress SEO columns from admin post tables
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?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' ); |
Thank you
And the latest addition:
unset( $columns['wpseo-links'] );
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' );
unset( $columns['wpseo-links'] );
can be added as well.
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
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
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' );