Products vs Collections urls

Solved
New Member
1 0 0

I'm seeing the following;

  • When navigating to a Product from a Collections page the Product page is displayed as .com/collections/collection-name/products/product-name
  • Looking at the Canonical link on that page it points to the true product page - .com/products/product-name

My question is, as our products only belong to one collection, is there a way to make the Product shown in the collection page link directly through the Collection page?

i.e. It looks the same however the products displayed link to - .com/products/product-name rather than .com/collections/collection-name/products/product-name

 

The reason I ask is that from an SEO point of view the internal linking from the collections pages point to the /collections/ URL which is then canonically redirected to /products/ which adds time to crawling the site as well as loses link equity through the redirect.

 

0 Likes
Highlighted
Shopify Partner
507 111 152

@aviannah987 

 

Replace the product.url in your collections template or other templates where collection product links are used.

{{ product.url | within: collection }}

and replace with

{{ product.url }}

 

for example:

product-url.png

 

 

Cheers,

Tejas

 

Shopify Expert | skype: tejas.nadpara
- Feel free to contact me on support@hexaecommerce.com regarding any help
- Like and Mark as an Accepted Solution if reply helpful
3 Likes

Success.

Shopify Expert
164 34 56

Hello Aviannah:
This is a great question. Unfortunately, it's not something that is able to be changed. Only handles are able to be adjusted. So you could change what the URL displays the product name to be, but the Shopify generated URLs will stay the same. 



 

 

11-41-m0jmk-1ewsk.jpg11-42-5nuke-4vhus.jpg

Basically, the URL is like breadcrumb navigation. Whatever the route that it takes to get to a product will be shown in the URL. So, in this case, the product was in the collection so it will show /collection/collection-name/products/product-name. 

i hope that helped to clarify for you :)

Problem Solved? ✔️Accept the solution so you can help others.
* Email: fayyazraza@gmail.com * Skype: fayyaz_raza
1 Like
Tourist
11 1 1

Thank You @Tejas_Nadpara 

This was very useful as I am having the same issue.

0 Likes
Tourist
10 0 0

Hi Tejas,

 

I am trying to achieve the same thing, but cannot find any reference to 'within: collection' in any of the collection template files.

Any clues on where else I can look?
The theme is debut

 

Many thanks,

Sylvia

0 Likes
Shopify Partner
507 111 152

@sylvie_n 

 

It would be in "product-card-grid.liquid" file.

 

Thank you,

Tejas

Shopify Expert | skype: tejas.nadpara
- Feel free to contact me on support@hexaecommerce.com regarding any help
- Like and Mark as an Accepted Solution if reply helpful
1 Like
Tourist
10 0 0

Hi Tejas,

 

Thank you for your quick reply. This file doesn't seem to exist on our theme.

Please see screenshots:

Screen Shot 2019-08-21 at 15.20.32.pngScreen Shot 2019-08-21 at 15.20.41.png

0 Likes
Tourist
10 0 0

Sorry, my mistake, I've found.

That worked - thank you so much!!

0 Likes
New Member
2 0 0

Hey guys, I am using Brooklyn theme, can you tell me which .liquid file can I locate this string?

 

thanks,

Sean

0 Likes
New Member
2 0 0

Found it .. it is within Product-grid-item.liquid🤙

0 Likes