Removing /product/ from Woocommerce Product Permalinks / Slugs

99% of WooCommerce users would prefer to use beautiful permalinks/slugs for WooCommerce product pages. But also for category pages!

We need a nice pluginRemove slug from custom post type  and some tricks.

After installing this plugin, we go to its settings page:

Remove slug from custom post type settings

Click the Save Changes button, your Woocommerce product page permalinks are now :

If you want .html instead of /   , simply type in html and save changes.

woocommerce slug html

Now your product page slug should be :

Cheers !

In many cases, this plugin works like a charm, but sometimes it won’t work, especially in latest version of WordPress, as you can see, this plugin is not updated for 2 years….

The most typical problem is :

for old products, the slugs were changed successfully, but we can’t create new products, we would encounter 404 error when opening new product pages !

The solution is simple and quite funny:

Just set the publish time to some time long ago, today is 10th Jan. 2014, I set the publish time to 2013. Save it, your product were now “published long ago”, and you will be able to open the page, no 404 error anymore.

woocommerce 404 error

Another typical problem is that:

This plugin applies to all custom post type by default, we can’t exclude it from some other custom post types, like Portfolio (many themes have this sort of custom post type). So solve this, open the .htaccess file on root folder on your site.

RewriteRule ^product /(.+)/$ /$1 [R=301,L]
RewriteRule ^product_variation/(.+)/$ /$1 [R=301,L]
RewriteRule ^/(.+)/$ /$1 [R=301,L]
RewriteRule ^/(.+)/$ /$1 [R=301,L]
RewriteRule ^portfolio/(.+)/$ /$1 [R=301,L]

As you can see, there are many rules for other custom post types, like product_variation and portfolio. I would like to disable url rewritten for them. So I removed them, this code block becomes:

RewriteRule ^product /(.+)/$ /$1 [R=301,L]

Note: Don’t remove the 1st and last 2 lines which begins with #

This entry was posted in WordPress. Bookmark the permalink.

12 Responses to Removing /product/ from Woocommerce Product Permalinks / Slugs

  1. Clanshop says:

    THanks Jeriff! your post helped us out… Thanks so much! This plugin is perfect!

  2. makeonlineshop says:


    Can you explain me why I read on other blogs that it is not a good idea to delete “product” form Woocommerce shops url ?

    Can you think about any internal problem ?

    I need to import products after shop migration to woocommerce and I would like to keep the old previous URLs that do not have “product” word.

    Thank you.

  3. Alice says:

    Thank you for the thorough post Jeriff. This plugin is awesome but quite pricey in my opinion.

    For those planning to get this, I would recommend using the coupon code: “ELFTRONIX” to get 7% OFF.


  4. Fallen says:

    Hi Jeriff, this post was really helpful! I read it and showed it to my collegae’s. We downloaded to try the plugin and it works perfect, our shop runs with almost 4000 products… So yes! Thanks so much!

  5. dan says:

    omg I’m a noob and have been searching for a solution to the 404 error for days. Asked 3-4 ‘developers’ and none could sort it. Changed the publish date as you said and its actually working lol. Thanks so much


  6. andy says:

    Thank you very much Jeriff,

    I get stuck with woocommerce product permanlink every time. Your post really help me alot,

    Thank you!

  7. David says:

    I understood and did. thank you very much but that’s the question.

    when I put in the permalink / product /% product_cat% it does not open the page vobosche. 404 is not an error. and writes a cyclic forwarding all. you know how to do so has become a reference site / category / product name?

  8. David says:

    hello. I did not understand the first part of your post. how to remove links from the product?

  9. janfeng says:

    Hi , Nice ! Ask a question:

    If the ‘product’ modified to ‘shop’, 301 should be how to write ?

Leave a Reply

Your email address will not be published. Required fields are marked *