WooCommerce- How to remove product & product-category from urls?

我们两清 提交于 2019-11-29 16:54:06

问题


I'm using WooCommerce on a WordPress and it adds product & product-category to the URLs. http://dev.unwaveringmedia.com/8dim/product-category/all-party-supplies/ http://dev.unwaveringmedia.com/8dim/product/14-snowman-serving-tray/

I need to remove 'product' & 'product-category' from the URLs. Is there any way to modify the permalinks and remove them?


回答1:


Its good practice for SEO and UX to have a product category base. Product category bases help to distinguish products from posts. I usually change the product category base to "our-products" or "products".

To do this go to settings->permalinks-> enter your desired product category base.




回答2:


There is an official answer to this in the WooCommerce documentation.

A snippet:

Unfortunately this is not possible due to the way WordPress resolves its URLs. It uses the ‘product-category’ (or any other text for that matter) base of an URL to detect that it is an URL leading to a product category.

There is a bit of followup explanation, and allegedly there are some plugins that make it possible, though it's not recommended.

You may also be able to 'hack' the core code and just change the strings they use for that permalink structure -- or maybe that's what the elsewhere-mentioned setting is intended to do?



来源:https://stackoverflow.com/questions/21130909/woocommerce-how-to-remove-product-product-category-from-urls

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!