[ [ 'name' => 'Catégorie 1', 'slug' => 'cat-1', 'parent' => false, 'description' => 'C’est ma catégorie', ], [ 'name' => 'Catégorie 2', 'slug' => 'cat-2', 'parent' => 'cat-1', 'description' => 'C’est ma sous-catégorie', ], ] ]; foreach ( $taxonomies as $tax => $terms ) { foreach ( $terms as $term ) { if ( $term['parent'] && $parent = term_exists( $term['parent'], $tax ) ) { $term['parent'] = $parent['term_id']; } wp_insert_term( $term['name'], $tax, $term ); } }