skip to Main Content

I am working with a taxonomy called "Menu group" in WordPress. I’m adding my own fields to the menu group items, however the built-in field "Description" will not be used and I want to remove it. How do I go about doing that?

The following image shows the field that I want to remove:
this field

2

Answers


  1. I think that the fastest way to achieve what you want is using CSS otherwise JS can give you a delay and it’d display the description field anyway. Here is the solution in CSS:

    body.taxonomy-name .term-description-wrap {
       display: none;
    }
    
    Login or Signup to reply.
  2. You can hide the Description field by adding the below code to your functions.php

    function hide_description_field() {
        $screen = get_current_screen();
    
        if ( $screen->id == 'edit-menu_group' ) {
            echo '<style>
                .term-description-wrap {
                    display: none;
                }
            </style>';
        }
    }
    add_action( 'admin_head', 'hide_description_field' );
    

    Make sure the menu_group in line 4 is replaced with the slug of the custom taxonomy.

    Login or Signup to reply.
Please signup or login to give your own answer.
Back To Top
Search