[SEO] How do I force collections to use the correct URL for products

Highlighted
New Member
4 0 0

On my website when you click on a product, the resulting URL goes like this:

/collections/[Collection Name]/products/[Product Name]

How do I make it so that wherever the product is on the website, it uses a the same URL like:

/product/[Product Name]

 

This is for SEO purposes so there is not duplicate content and the search engines can see them as one page.

Also I am seeing a variant parameter at the end of all my product URL's that looks something like: 

?variant=1211346568

This shows up whether or not the product has variants. Is this normal and does it affect SEO?

My website is 310audio.com for anyone who wants to see it in action. 

0 Likes
Highlighted
Shopify Staff
Shopify Staff
368 0 38

Hello Josh, Ben here - your Shopify Guru! 

  There is two way to reach products via the collection and directly linking to them. They will have different url structures. The way your products are linked is actually in your theme code. You can change the collection listing pages to generate links directly to your products instead of going through the /collections/product/ structure. There is a forum thread that talks about this with direction on how to achieve this here:

https://ecommerce.shopify.com/c/shopify-discussion/t/urls-not-seo-friendly-139002

For removing the variant id at the end of your urls this would be generated by the variant selector Javascript in your theme. There is a forum post that talks about removing this here:

https://ecommerce.shopify.com/c/ecommerce-design/t/remove-variant-id-from-product-url-226641

I hope this helps! Feel free to reach out if you have any further questions :)

Cheers,
Ben C - Shopify Guru
Support@Shopify.com

 

0 Likes
Highlighted
Astronaut
1890 1 431

@Benjamin C -- One of your links just circles back to this thread. Do you still have a link to the page that you wanted to share?

 

@Josh Sam -- Changing the structure of the linked URLs depends on the theme that you're using.  Usually you'll want to look for the within filter and remove it.

If using the launchpad theme, open Snippets/product-loop.liquid.  Modify the first two lines.

{% capture collection_handle %}{{ product-loop | handleize }}{% endcapture %}
{% capture url %}{{ product.url }}{% endcapture %}

I hope this helps.

0 Likes
Highlighted
Shopify Staff
Shopify Staff
368 0 38

Hey Alex, 

Thanks for the heads up about the incorrect link. I have updated my original post but here is the similar thread again.

https://ecommerce.shopify.com/c/shopify-discussion/t/urls-not-seo-friendly-139002

I hope this helps! Feel free to reach out if you have any further questions :)

Cheers,
Ben C - Shopify Guru
Support@Shopify.com

0 Likes