Post tags saving as both tag name & tag ID on post update when tags are displayed as checkboxes

Faced this problem too.

You can solve it adding to functions.php filtering code:

add_action( 'admin_init', function() {
    if( isset( $_POST['tax_input'] ) && is_array( $_POST['tax_input'] ) ) {
        $new_tax_input = array();
        foreach( $_POST['tax_input'] as $tax => $terms) {
            if( is_array( $terms ) ) {
              $taxonomy = get_taxonomy( $tax );
              if( !$taxonomy->hierarchical ) {
                  $terms = array_map( 'intval', array_filter( $terms ) );
              }
            }
            $new_tax_input[$tax] = $terms;
        }
        $_POST['tax_input'] = $new_tax_input;
    }
});

Full code in forked snippet
https://gist.github.com/antonlukin/da2b8107c67e677928a87398d89ca202

Leave a Comment