Skip to content

Instantly share code, notes, and snippets.

@EdenK
Created December 28, 2017 10:47
Show Gist options
  • Save EdenK/c8e0bc1990f3877d1922eb256c67979b to your computer and use it in GitHub Desktop.
Save EdenK/c8e0bc1990f3877d1922eb256c67979b to your computer and use it in GitHub Desktop.
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' );
*/
@chrisku
Copy link

chrisku commented Oct 6, 2021

Thanks for making this. You could add unset( $columns['wpseo-linked'] ); to the function.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment