Change product Url via API and enable rewrite on old url

1 0 0


when I change the url from the shoify backend I can choose the possibility  to create an URL Redirect from the old link to new one..
But, since I want to do the same thing via API, when I change the "handle" field it creates a new Url but old one became a "not found page"... there is a way to set this "create URL REDIRECT" via API?


Thnak you very much




Reply 1 (1)

Shopify Staff (Retired)
267 40 51

Hi @Happycasastore 


While it's not part of the product update mutation, you can create a URL redirect via a separate mutation using UrlRedirect. Here is some documentation about the mutation:


Hope this helps!

To learn more visit the Shopify Help Center or the Community Blog.