How can I change my shopify url Structure

Replies 31 (31)
Devon_Meadows
New Member
2 0 1

Thanks! Worked for me over at Awake Happy.

dagansmith1
Tourist
5 0 1

Thanks @beardfactor - the Paul Rogers advice worked perfectly 

MartinG
Tourist
4 0 0

how is the work around to handle /collections/  ?

MJ2021
New Member
1 0 0

HI All

Is there an answer on how to update the entire URL structure and not just a single product URL?

Thanks

KuznetsEnvy
Shopify Partner
31 0 8

Hi, Shopify experts. I'd like to hear your advice.

We have a store with less than 5 products. We want short URLs for products like mysite.myshopify.com/my_product.
We think we can pull it through with this technique:
1. Create a product. Default URL would be mysite.myshopify.com/products/my_product
2. In Shopify admin set up redirect mysite.myshopify.com/my_product -> mysite.myshopify.com/products/my_product
3. In product pages template add JavaScript
<script>
/* Pretty URL manipulation */
function makeProductUrlPretty() {
let product_handle = window.location.href.split('/').pop();
let pretty_url_for_product = window.location.protocol + "//" + window.location.host + '/' + product_handle;
window.history.pushState({path:pretty_url_for_product},'',pretty_url_for_product);
}
makeProductUrlPretty();
</script>

Same concept can be applied to blog articles and pages.

Downsides I see:
– Necessity to manually set up redirects for every product/article/page
– If the product has variants, it can be troublesome to manage the ?variant=123456789 parameter to be handled correctly with this short URL

Is there any reason to think Google could penalize us for this? Which could be the arguments why it's good or bad for SEO?
Any thoughts are welcome.

mkz2
Tourist
4 0 2

I wouldnt use this for products, but for blogs. I have seen Shopify shops with blog URL structures like the following: example.com/blogs/blog/article-handle

This looks extremely silly and is a surefire way to prevent real people from remembering the real URL of a blog article. Was it example.com/blog/blogs/article-handle? Or was it blogs/blog?

Furthermore, for some Shopify pages example.com/blogs results in a 404. Sure, you can set up redirects, but those all have to be set up.

 

Ideally Shopify would offer the option to use URLs that are made with humans in mind: example.com/blog/article-handle

It is hard to believe that something that is so obviously useful and at the same time so very basic is not possible unless you go with a headless Shopify shop.

 

garyvela
Shopify Partner
2 0 0

Any luck on this?

mkz2
Tourist
4 0 2

No luck whatsoever. I think going headless is the only solution.

Liquify
Shopify Expert
86 0 46

As a long term Shopify expert I'd say this is up there on one of the most annoying things about Shopify which has never been addressed. 

There's a bunch of use cases for needing to modify the core url structure. Migrations and not wishing to lose SEO positions  / languages being main 2.

 

There's a few mixed threads going on here. So I'll clarify as things stand and will stand for a long time.

having all product urls without the collection path in them is easy but may present some issues with related products.

e.g. you can have all links going to 

https://www.website.com/products/item1
and not

https://www.website.com/collections/category/products/item1

that takes 5 mins in the theme and is a doddle for any Shopify developer.

what you can't do is for example if you're a German store is:

https://www.website.com/producte/item1

 

or if portuguese
https://www.website.com/productos/item1

 

or if you sell bling

https://www.website.com/bling/sick-treads

 

you can't do that natively on Shopify and don't hold your breath for that one.  Been asking for it for ever.


You can do it by going headless but this is not at all sensible in most cases (cost being main factor - it's prohibitively expensive for most merchants to build and maintain). This is the only option for modifying the core URL structure.

 

You can also have custom urls without using headless by using app proxies to render any non system url. But again - this would involve a lot of cost / dev time time and your canonicals would always be /products or /collections etc so it wouldn't be suitable in most contexts. The core structure would remain the same but you could have some aesthetic urls. We're doing this right now but for rendering some content which just doesn't fit /pages or /posts etc.

so for example you could create a url like this

https://www.website.com/a/bling/sick-treads
but the canonical would be https://www.website.com/products/sick-treads

so yeah, there's a couple of options if you have budget / time
but they don't suit most cases where people simply want to change /products/ or /pages/ etc and move on with life
that ain't happening 😥

★★★ Need help setting up your Shopify store? Hire me here: https://liquify.design ★★
Giant_Sports
New Member
1 0 0

Yes, I need this for my website too, but specifically for the blog part. I migrated my website and now all my article URLs are broken. They all have SEO juice flowing through them and they now stopped. I don't want to add over 100 redirects when this should just be a feature.

Pratik30
New Member
1 0 0

Hello Everyone, 
I got the solution.
https://paulnrogers.com/how-to-change-the-product-url-structure-in-shopify/
I found this article which is very useful. 
===========
if you have this type of link 
https://www.website.com/collections/category/products/item1 
and want to convert this link to this one...
https://www.website.com/products/item1
==========

Suggestion: if you didn't find the file name: product-grid-item.liquid
then try to find other files related to this name, and try to find this code "{{ product.url | within: collection }}"

yalnik
Shopify Partner
1 0 0

@Pratik30 I'm not able to locate the code "{{ product.url | within: collection }}" anywhere in my shopify store. Can you help?