I have written some long descriptions for a custom category taxonomy. I don’t want to remove them, I just want to hide it from the management page:

/wp-admin/term.php?taxonomy=custom_category

I could use CSS to hide the class “column-description”, but I don’t know how to only apply it to this taxonomy.

3 s
3

You could target the edit form for the post_tag taxonomy, through the post_tag_edit_form hook:

/**
 * Hide the term description in the post_tag edit form
 */
add_action( "post_tag_edit_form", function( $tag, $taxonomy )
{ 
    ?><style>.term-description-wrap{display:none;}</style><?php
}, 10, 2 );

Here you can also target an individual tag.

If you need something similar for other taxonomies, you can use the {taxonomy_slug}_edit_form hook.

Update

It looks like the question was about the list tables, not the edit form.

I dug into the list tables in WorPress and found a way to remove the description column from the term table in edit-tags.php

/**
 * Remove the 'description' column from the table in 'edit-tags.php'
 * but only for the 'post_tag' taxonomy
 */
add_filter('manage_edit-post_tag_columns', function ( $columns ) 
{
    if( isset( $columns['description'] ) )
        unset( $columns['description'] );   

    return $columns;
} );

If you want to do the same for other taxonomies, use the manage_edit-{taxonomy_slug}_columns filter.

Leave a Reply

Your email address will not be published. Required fields are marked *