Got to Settings -> Permalinks ->
In ‘Product permalink base’ select the ‘Shop base with category’ option.
After saving if the .htaccess file is not writable then WordPress prompts you to create the .htaccess file and add the code which the mention after saving in the .htaccess file.
The reason that it is giving 404 error is that the Permalink structure needs the code to be added to .htaccess file or the settings which you saved will only apply when not using “default” permalinks for ‘Common Settings’.
Related Posts:
- How to get permalinks with category base working with sub-categories
- Catch 404 after changing permalink structure from /%postname%/ to /%category%/%postname%/
- Multiple post categories – single permalink
- How to create a custom url for a category [closed]
- How to Include the Parent and Child Category in the Permalink if the Post is Added to Both
- Exclude subcategories from the url
- Add “page-a” slug to category link if user visit category link from “page-a”
- Remove subcategory and category with some rules from permalink
- Hierarchical permalink structure for posts showing categories and sub-categories
- A different permalink structure for different categories
- How to remove category name for only one category?
- Category URL’s 404 after setting category base to ‘.’
- Accessible Subcategory URL’s pages without using .php hack
- Catch 404 after changing permalink structure from /%postname%/ to /%category%/%postname%/
- Multiple Parent Category URLs
- How do we ReWrite HTACCESS to point a cat/subcat Product URL, to Cat/ only?
- Building Menu from Woocommerce Product Categories
- Include WooCommerce product to all child categories
- woocommerce related products by specific categories [closed]
- Use the category name instead of category slug in permalinks
- Nicer URL for viewing category of posts?
- How do I add a tag slug to a category URL to filter posts?
- Change of category structure will cause two kinds of URLs for one post
- Do not show sub categories in the loop on archive-product.php
- How to Link to Most Recent Custom Post of Same Term
- Function to automatically rename the base category permalink
- List just subcategory and products of active category page in Woocommerce
- Cannon see subcategory in permalink
- List a maximum of ‘x’ product categories with qty of ‘y’ in each column
- Display all product tags associated with a specific product category
- why get_the_post_thumbnail( the_ID()) echos extra post id
- Redirect Changed Permalink on wordpress
- How to access deleted term inside delete_product_cat action
- Apply WordPress function on specific woocommerce product categories only
- Filter WooCommerce archive pages by an additional category
- Category url generate 404 error
- How to remove one specific category (uncategorized) from post permalinks
- Grandchild Term Things Grandfather Term is It’s Parent
- What Must to Display the “mysite.com/category” URL?
- Custom Permalink with child categories creating 404
- Custom tax_query filter not working for Woocommerce product categories
- How do I retrieve the category ID (ugly permalinks) in my sub-navigation menu?
- How do order product categories – on a parent category page – in Woocommerce?
- Woocommerce filter function not updating
- Adding custom ID field to the categories
- How can i change what one category displays?
- How do I change the category permalink structure?
- Remove any product that is featured from regular display loop [WooCommerce]
- Two Sections on Woocommerce Catergory Page [closed]
- Woocommerce search form with category select
- How to display product with two condition, category and brand taxonomy
- Show different menu on each woocommerce category page
- Template for product-category page [closed]
- Redirect year month day postname permalink structure to category postname structure
- category link not working for a specific slug, works for others
- url for posts for a date within a category
- Advanced permalinks structure
- Pagination breaks on child-categories, works fine on parent-category
- Is the part “category” fixed to an URL to an archive or post?
- prefix to post permalinks without affecting category permas
- Category URL Management
- Categories show 404 error on multisite installation
- Need help with major category and permalink re-organization
- Global navigation in multisite: problem with categories
- Subcategory Page URL to Display Only Posts from that Subcategory?
- Include specific category in URL automatically
- WooCommerce shared categories
- WooCommerce Product category can be shown with multiple related URLs
- displaying the last product comment in the woocommerce category
- Displaying Single Product Page Parent and Child Category
- WordPress Primary Category Changes After Import, Permalink Issue
- How to use category slug with a regular page
- Woocommerce only display child category when parent is checked (on add new product page)
- Using custom structure prefix showing 404 for sub-categories
- Can I show category name in url for only one of my categories?
- How to add tags under categories
- Allow two posts (from different categories) to have the same slug
- category description not showing in my woocommerce
- Conditional label Woocommerce archive [unsolved]
- One Time Access URL after purchasing subscription
- Show audio player only in specific post type category
- How to set the same base url for two different taxonomies?
- How to make product image inherit from category image
- Subcategories randomly not working after page/post/category edit in wordpress. Fix: saving permalinks twice
- How to show given products only using product id array from specific category page in woocommerce
- Get multiple category names from permalink
- Shop Category Pages missing s
- How to set acf color field as background color to product category
- Get category base permalink
- How to target all woocommerce categories that don’t have any subcategories in them?
- Is this process OK to replace URL structure?
- Is it possible to set up blog categories without changing permalink structure
- WooCommerce REST API not returning the default products category
- In if…else condition, the else statement shows even if if statement is correct
- How to show WooCommerce Categories on ‘shop’ page instead of products?
- Show the parent taxonomy by creating shortcode in woocommerce?
- Can a Woocommerce product category URL contain “&”?
- How can I display all products from all categories on one page with woocommerce?
- Remove WP Core canonical for category pagination
- How to add all subcategories as submenu in WordPress menu