I use Custom Post Type UI plugin to create new post types and taxonomies.
I created post type cpt_recipes
"has_archive" => "recipes",
"rewrite" => [ "slug" => "recipe", "with_front" => true ],
First taxonomy cpt_recipes_cat
"hierarchical" => true,
"rewrite" => [ 'slug' => 'recipes/category', 'with_front' => true, 'hierarchical' => true, ],
Second taxonomy cpt_recipes_ingredient
"hierarchical" => true,
"rewrite" => [ 'slug' => 'recipes/ingredient', 'with_front' => true, 'hierarchical' => true, ],
Now how to remove /category
and /ingredient
from the taxonomy archive url and make it work?
Or how to remove only /category
from the first taxonomy archive url and make it work?
cpt_recipes_cat
term archive url to look like /recipes/category-name/ and forcpt_recipes_ingredient
term archive url /recipes/ingredient-name/. At now when I remove from rewrite rule /category or /ingredient I gets Error 404 at term archive.