1

I have a woocommerce site setup with a blog.

For the shop:

  • example.net/shop (Shows all products)
  • example.net/shop/category (Shows all products in the category)
  • example.net/shop/category/product (Shows the product)

For the blog:

  • example.net/blog (Shows all posts)
  • example.net/blog/category (Shows all posts in the category)
  • example.net/blog/category/post (Shows the post)

My Permalink Settings are:

Common Settings

  • Custom Structure - /%category%/%postname%

Optional

  • Category base - blog
  • Product category base - shop
  • Product tag base - tag

Product permalinks

  • Custom base - /shop/%product_cat%/

As I said the links are working as I want them to work, when I create a post category I get the url "example.net/blog/category-slug" but when I create a post and add it to the category the permalink I get is not "example.net/blog/category-slug/post-slug" it's "example.net/category-slug/post-slug"

By the ways there will be no subcategories used.

4
  • 1
    The category base is just for category permalinks and not post permalinks. Hence the name "category base". To have the blog in the post permalink, you'd need to set the permalink structure to /blog/%category%/%postname%/, but that would result in a conflict with the blog as the category base.
    – Sally CJ
    Mar 18, 2020 at 2:06
  • Got it working thank you! I had to set the Common > Custom Structure to "/blog/%category%/%postname%" and the category base to "blog/.". The shop permalinks are unaffected.
    – Daviid
    Mar 18, 2020 at 10:20
  • Well yes, that blog/. may work in avoiding the conflict, but if I'm not mistaken, that will not work for /blog/<category-slug>/page/<number> (e.g. example.com/blog/uncategorized/page/2), i.e. paged requests for a category.
    – Sally CJ
    Mar 19, 2020 at 7:54
  • @Daviid I tried your suggestion but with "blog/." set to category base now it gives 404 for the category page. I tried exactly the same configuration as you have suggested. Am I missing something? did you make any changes from the backend to make it work? Dec 2, 2021 at 6:54

0

Your Answer

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

Browse other questions tagged or ask your own question.