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.
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.
Share Improve this question asked Feb 12, 2020 at 7:46 Vishal BhattVishal Bhatt 1413 bronze badges1 Answer
Reset to default 0Please 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