Created
December 28, 2017 10:47
-
-
Save EdenK/c8e0bc1990f3877d1922eb256c67979b to your computer and use it in GitHub Desktop.
Wordpress: Filter admin columns and remove yoast seo columns
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 | |
/** | |
* Wordpress: Filter admin columns and remove yoast seo columns | |
*/ | |
function yoast_seo_remove_columns( $columns ) { | |
/* remove the Yoast SEO columns */ | |
unset( $columns['wpseo-score'] ); | |
unset( $columns['wpseo-title'] ); | |
unset( $columns['wpseo-metadesc'] ); | |
unset( $columns['wpseo-focuskw'] ); | |
unset( $columns['wpseo-score-readability'] ); | |
unset( $columns['wpseo-links'] ); | |
return $columns; | |
} | |
/* remove from posts */ | |
add_filter ( 'manage_edit-post_columns', 'yoast_seo_remove_columns' ); | |
/* remove from pages */ | |
add_filter ( 'manage_edit-page_columns', 'yoast_seo_remove_columns' ); | |
/* remove from woocommerce product post type */ | |
add_filter ( 'manage_edit-product_columns', 'yoast_seo_remove_columns' ); | |
/** | |
* can remove from custom post types too | |
* add_filter ( 'manage_edit-{custom_post_type}_columns', 'yoast_seo_remove_columns' ); | |
*/ |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Thanks for making this. You could add unset( $columns['wpseo-linked'] ); to the function.