Product URL routing - Remove collection but keep breadcrumbs

Product URL routing - Remove collection but keep breadcrumbs

Markitosline
Tourist
7 0 1

Hi there!

 

Our website has MANY ways to find and land on the same product, by cuisine type, properties of the material, etc.

 

This leads to around 20 unique URLs per product, as this is generated due to the many collections we use to guide our customers.

 

These collections with the whole path domain/collection/product/itemxyz are showing as blocked by robots, and the actual product/itemxyz URL which is actually ranking organically has little to no traffic because you only get to the product mainly via the collection page.

 

I've found a solution for my theme empire, by removing the href created coming from a collection, in both the quick view and product grid sections of the code, by removing the | within: collection subfix at the product-grid level of my code

 

 

{% assign product_link = product.url | within: collection %}
href="{{ product.url | within: collection }}"

 

 

The problem is now that I've done that, my breadcrumbs which are built depending on the URL of the page, won't show the actual path, which even tho I doubt many users might benefit from, it's still a best practice in e-commerce and would like to keep it.

 

My two questions are:

 

  1. is there another solution to my problem with the URLs that might let GA and robots understand the product page as a unique item and ignore the first part of the URL path?
  2. if the above is not possible and what I've done is closer to a permanent solution, how can I keep showing breadcrumbs based on the previous page and not the one the user is presently in?

Many thanks!

Replies 2 (2)

JHKCreate
Shopify Partner
3571 638 932

Hi @Markitosline 

 

Solution #2 would make more sense and can be done in one way at the top of my mind:

Appending a URL parameter from the collection and reacquiring it to render the breadcrumbs based on said value. URL queries are not new URLs and don't create duplicates. 

 

Let me know what you think!

Did we solve your issue? Like & Mark As Solution to help the community
Should you need any direct help: contact@jhkcreate.com

Learn more about us: jhkcreate.com
Markitosline
Tourist
7 0 1

This might be a quick solution that I'm willing to explore hehe

 

Many thanks! Will let you know how we go about it and if we get a solution I will post it here