Wocommerce Products 404 Issue – [Fixed]

Recently I had been trying to fix WordPress permalinks on a website using following plugins.

1. Yoast WordPress SEO

2. Custom Permalinks

3. Wocommerce

Its been a mess finding a solution to fix pretty permalinks for WordPress as wocommerce doesn’t offer any solution for the clean URLs. I tried cried and wasted lots of time using different plugins to fix this issue but faced a failure. What I wanted to achieve was something like following

www.example.com/product_category/dresses to be www.example.com/dresses

www.example.com/product/product-name to be www.example.com/product-name

I set the permalinks to %postname% but individual products were going 404. I even tried installing following plugins to get rid of product and product category base from URL.

1. WP No Category Base

2. Remove Slug from Custom Post Type

3. Ultimate SEO

Found this on wordpress forum and somehow it did work resolving my homepage to just Blog style and removing few other settings so I had to un-install it.

Yoast also provides a feature to strip Base Category URL but it requires to set permalinks for %postname% and this doesn’t let individual products to work properly and hence they go 404.

Wocommerce is a great plugin with few SEO limitations and unfortunately they don’t help in this regard and available solutions work from theme to theme,.

Coming back to the original topic that while setting up permalinks to %postname% doesn’t let products to work and hence try to redirect like following URL structure, ending up as broken URL but works when you set permalinks as default structure. No clean URLs

Redirects from example.com/products/bags to example.com/bags and goes 404

Wocommerce plugin uses Category as base url structure and when you set up permalinks as %postname% its more like you want to go on a second floor without using the stairs. Instead using %postname% use the following in permalinks

1. %Category% for custom structure under Common Settings

2. /Product/ under Product permalink base

This will allow Wocommerce to achieve clean URLs, I’m aware that you will still have category base in URLs but will get rid of ugly permalink structure.

I’m still finding an easiest way to clean URLs that works with most of the themes. I’m open for suggestions and your feedback in comments sections.