Last Updated on June 3, 2019
Let’s be honest,
Woocommerce default product and category urls SUCK!
Am I right or what?
Anyway there’s a simple solution that’s 100% automatic, and removes the /product-category and /product/ parts of the woocommerce permalinks.
PLUS it gives you the option to edit the product canonical urls.
It’s called the Perfect SEO Url plugin, and the video below will demo it for you.
Explanations of Proper eCommerce Canonical Urls
So the way you structure your eCommerce permalinks and canonical urls is very dependent on the way you setup your website.
There are two ways of setting up your eCommerce website:
- Each product to only be displayed in one category.
- Each product to be displayed in multiple categories.
For example if you sell Laptops, and you have a specific Large Screen, HD Laptop with 8GB Ram. This product could simply be found within the Laptops category, or it could also be found within the HD Laptops, the 8GB Ram Laptops, etc.
Structure When Products Are In One Category Only
If you have this simple structure with products only tagged to one category, then your permalink structure should match your canonical url, and should be in the following format:
- Category -> Product permalink: domain.com/category/product-url
- Product canonical: domain.com/category/product-url
This means that Google will index that version, and it’s also the version linked to from your category page.
To implement this using the Perfect SEO Url plugin, you should enable the following settings:
Structure When Products Are In Multiple Categories
With this slightly more complicated setup you need to ensure your product canonicals and permalinks are consistent with this:
- Category -> Product permalink: domain.com/category/product-url
- Product canonical: domain.com/product-url
This is because you will also have category -> product links like domain.com/category2/product-url and domain.com/category3/product-url etc, which would create duplicate pages on your website.
Adding the canonical prevents this, allowing Google to only index the domain.com/product-url version.
The way to implement this with the Perfect SEO Url plugin is as follows:
This will give you the clean woocommerce urls that you’re looking for, while improving your Google rankings at the same time.
Looking for a free workaround?
So was I!
I literally searched the web for days looking for a manual override or hack…
Only to find it was literally IMPOSSIBLE!
So I advise you to save yourself some time by spending a little money, $119 to make all your woocommerce product-category slug problems melt away!
Hi there,
After setting this amazing plugin the way you mentioned, I realized it’s adding noindex tag to all non canonical product urls
so if i have a product that shows 4 times in different categories.
3 of them get the “noindex” and one, which is the canonical URL, doesn’t get any noindex tag.
Is this how it’s supposed to work?
Thanks,
Ron
No this sounds like another plugin is inserting noindex into the other product variations.
Try uninstalling all possible plugins on a dev environment and test again, the plugin is supposed to show all variations and just canonical them to the version you want indexed.
If you need any help you can always email me at info@matt-jackson.com
Hi Matt,
thanks for post,
i have bought Perfect SEO Url plugin but instead of improving I’ve lost traffic because the plugin creates duplicates of products.
The assistance of perfect seo url is absent, and I do not know how to solve,
I do not recommend buying because it does not work well.
Best Regards
Hi Luca, although it may create duplicate “paths”, they should all have the same canonical url, which means there is never duplicate content within Google.
Having checked your website I can see that it works fine, perhaps you could be more specific, so that I can check further…
Hi Matt, I did a search and found this post which is great. I just posted to the WordPress forum and wondered if you could tell me if the solution I am looking for would be solved with the plugin you referenced, or if I simply manually added the canonical URL in the Yoast plugin for each product.
If you have a moment, I’d love it if you would look at this post and advise.
https://wordpress.org/support/topic/help-question-on-canonical-to-avoid-duplicate-content-with-google/#new-topic-0
Ultimately we have a site with many products and each product has multiple categories. We always want to see the URL change correctly with the main/subcategory URL structure -however, we dont’ want Google to ding us for what they may perceive as a duplicate content.
I explain it more on the forum post but I am thinking this is what your main subject is on your post. I just need someone to confirm this with me. Please 😉
I hope to hear back from you. Thanks so much, Matt.
Hi Carlos, do you have any plugins installed for your url structure?
You are missing the canonical link element which is a big problem, as this prevents duplicate pages from multiple paths being indexed.
Woocommerce doesn’t behave how your site is behaving by default, so I presume you have some customisation / plugins going on there.
Feel free to drop me an email at info@matt-jackson.com and I may be able to assist further.
The Premmerce Permalink Manager is free and does 80-90% of the job + combined with Rank Math or another SEO plugin that removes the base categories, it could be sufficient. But yeah, Perfect SEO URL is great on its own, just a little expensive.
I completely agree with you Tom. Not to mention the plugin hasn’t been updated for a year now. I will be updating the post to reflect the better solution.
Perfect information. Thanks for sharing this quick information. It’s really amazing special for the beginner like me.
You’re welcome Luna.
WooCommerce does not recommend removing these from URL’s……
https://docs.woocommerce.com/document/removing-product-product-category-or-shop-from-the-urls/
Why do you feel this is necessary and how do you avoid conflicts?
Hi Kevin,
Their first point is effectively solved with good site management.
The second related to performance – I have clients running this solution who have perfect page speed/Core Web Vitals scores, so I don’t believe it’s a huge issue.