Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
Wordpress: Filter admin columns and remove yoast seo columns
<?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