0

I am trying to remove parent category from the child category but nothing happens. I have a website made with the use of EDD. currently i have categories like below:

  • angular-templates
  • react-templates
  • bootstrap-templates

In each categories, there are sub-categories/child-categories as below:

angular-templates

  • angular-1
  • angular-2
  • angular-3

now if i go to my sub-category, url displays as below:

http://admin-pc/mysite/templates/category/angular-templates/angular-3/

And i want to remove angular-templates or whatever is the category name in url to remove and display url as below:

http://admin-pc/mysite/templates/category/angular-3/

Is it possible with add_rewrite_rule()?

I have achieved what i want with str_replace, but that will affect site's SEO, so that's not possible.

1 Answer 1

0

Please check if any of the solutions work for you. There are a few ways we can try to achieve this.

Through WP Permalinks Go to Settings >> Permalinks and select Custom and enter: /%category%/%postname%/ Next set your Category Base to .

Through Yoast Plugin Go to Yoast SEO Select advanced Click on the tab permalinks at the top Check Strip the category base (usually /category/) from the category URL

Use Remove Category Url Plugin

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.