admin管理员组文章数量:1391924
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
本文标签: categoriesHow to remove parent category from child category url using wordpress rewrite rule
版权声明:本文标题:categories - How to remove parent category from child category url using wordpress rewrite rule? 内容由网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://www.betaflare.com/web/1744755259a2623423.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论