How to change the product link on collection pages to canonical URL?

How to change the product link on collection pages to canonical URL?

Shopify Partner
1 0 0

Google Search Console is reporting all product links that contain the collection slug as 'Not Indexed - Alternate page with proper canonical tag'. 


Here is an example of a product canonical URL


The link to this product from a collection page is


Links like these are being increasingly flagged by Google Search Console with the above issue.


I want to modify the collection page code so that the link to the products are their canonical URLs without the collection slug. 


Can someone please guide me which file to edit. I am using Empire theme. 

Replies 2 (2)

Shopify Partner
209 27 71

Hey @jaffri 


You can use this article to guide you on removing what's called the collection-aware URLs.


I don't have the Empire theme so I can't tell you which theme file but you can look through your files to find within:collection

Ilana Davis, Shopify Superhero
JSON-LD for SEO, adds structured data to your theme, getting you more organic traffic with Rich Results.
Linking Llama, link complementary, comparable, or related products to improve SEO & UX.

Shopify Partner
148 19 30

Hi @jaffri ,

  1. Under Online Store, Go to Themes.
  2. Click on the three dots next to Customize button, click on Edit Code.
  3. Go to the section Snippets and click to expand the details.


Look for a file named "product-card-media-gallery." You can edit the code from there.

I believe depending on your Theme, the file could be named slightly differently.


Hope that helps.


Best of luck,


I help store owners to double their traffic and sales by getting on Google and YouTube page one. Check out my YouTube channel for more tips and tactics to drive traffic and sales ➤

Download my Shopify Marketing Guide to learn both FREE & PAID ways to drive visitors to your store that convert into paying customers. ➤