0

I'm using Woocommerce plugin, currently I don't set anything in "Product category base", so my woocommerce archive looks like /product-category/category2/. I want to remove "product-category" part away so my archive page will be /category2/ I think I can do that by set './' in permalinks settings.

But what if I already have a normal Wordpress page with a slug /category1 already and want to redirect to this page (not woocommerce /product-category/category1 without product-category) but I still want /category2 is a woocommerce archive.

  • When I enter /category1 -> redirect to a normal page with this permalink (eventhough I still have /category1 archive page but not use it).

  • When I enter /category2 -> redirect to Woocommerce archive category2 (because I don't have any page with the same permalink).

Is it possible to do it, I have not tried cuz I'm affraid of breaking my site. Hope you can give me advice, Thanks.

0

Have a look at this

https://kellenmace.com/remove-custom-post-type-slug-from-permalinks/

I use it with this plugin: Code Snippets By Shea Bunge

This allows you to modify your functions.php file without having to directly edit it. This means WordPress core and theme updates won't remove your changes.

Finally, may I suggest you try using a staging plugin to make a development version of your site so that you don't have to try things out on the live site.

Try this: WP Staging – DB & File Duplicator & Migration By WP-Staging

I hope that helps.

Warmly Steve

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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