Removing the CPT-onomy Admin Column

Remove the CPT-onomy’s admin column, and/or it’s sortability, by returning false to the following filter(s).

Some need-to-knows about filters:

  • To use this filter, tweak the code below and add it to your functions.php file.
  • If a filter accepts more than one argument, you have to declare the number of arguments in your add_filter() declaration, along with the filter’s priority.
  • All filters MUST return a value, i.e. the value being filtered.
  • For more information, check out add_filter() in the WordPress codex.

Remove the column altogether:

<?php
add_filter( 'custom_post_type_onomies_add_cpt_onomy_admin_column', 'my_website_add_cpt_onomy_admin_column', 1, 3 );
function my_website_add_cpt_onomy_admin_column( $add_column, $taxonomy, $post_type ) {
   if ( $post_type == 'movies' && $taxonomy == 'actors' )
      return false;
   return $add_column;
}
?>

Remove the column’s sortability:

This filter was deprecated in version 1.3.
Does not remove the column, just disables it from being sortable:

<?php
add_filter( 'custom_post_type_onomies_add_cpt_onomy_admin_sortable_column', 'my_website_add_cpt_onomy_admin_sortable_column', 1, 3 );
function my_website_add_cpt_onomy_admin_sortable_column( $add_sortable_column, $taxonomy, $post_type ) {
   if ( $post_type == 'movies' && $taxonomy == 'actors' )
      return false;
   return $add_sortable_column;
}
?>