Remove Parent term slug from URL when Child selected if not keep Parent term slug in URL

Question

i have parent-child relation in taxonomy(city) terms, now i want to keep parent term slug in URL only if there is no child attached with a post like this is my URL structure

example.com/state/city/store-number/store

now in city taxonomy, i have parent term Chicago and then child term Villa park, and URL structure is

example.com/illinois/chicago/villa-park/8716508/anca-micoara-ea/

now in the above URL both parent (Chicago) and child term (Villa park) attached with a post please check the screenshot here https://prnt.sc/vb3n13
so for this, URL structure is fine but i want when i select only child term for the post i want URL structure something like this

example.com/illinois//villa-park/8716508/anca-micoara-ea/

please check the screenshot here https://prnt.sc/vb3orl
like i want to remove parent term from URL when only child selected, not sure how i will do that? am using the permalink manager lite plugin but i don’t see any option for this

0
Jamil Ahmad 3 months 0 Answers 7 views 0

Leave an answer