Yoast SEO: Remove SEO and Readability Columns from Post Lists
Removes the Yoast SEO score, readability score, SEO title, meta description, and focus keyword columns from all post-type list tables in the admin.
PHPby SnipCraft
php
<?php
if ( ! function_exists( 'scseed_remove_yoast_columns' ) ) {
function scseed_remove_yoast_columns( $columns ) {
if ( ! defined( 'WPSEO_VERSION' ) ) {
return $columns;
}
$keys = [
'wpseo-score',
'wpseo-score-readability',
'wpseo-title',
'wpseo-metadesc',
'wpseo-focuskw',
'wpseo-links',
'wpseo-linked',
];
foreach ( $keys as $key ) {
unset( $columns[ $key ] );
}
return $columns;
}
function scseed_register_yoast_column_removal() {
if ( ! defined( 'WPSEO_VERSION' ) ) {
return;
}
$post_types = get_post_types( [ 'show_ui' => true ], 'names' );
foreach ( $post_types as $pt ) {
add_filter( "manage_{$pt}_posts_columns", 'scseed_remove_yoast_columns' );
}
}
add_action( 'admin_init', 'scseed_register_yoast_column_removal' );
}#admin#cleanup#columns#seo#yoast-seo