Access a community of over 900,000 Shopify Merchants and Partners and engage in meaningful conversations with your peers.
I'm trying to programmatically add tags to products.
The only option I see would be using the /products/<#id>.json POST , but it seems this would replace the tags? Is that assumption correct?
Is there a better way to add tags to the existing list of tags?
Yes, It will replace tags, and no direct option to append tags,
But we generally use this way.
Hello Ashish,
i agree with you but i know shopify provide less facilities can you provide any guidline so i can append some of tags using api
ex:- my product tag : category_saree,color_black,size_xxl etc...
and i want to append product tag : Catelog_latest-product,hot_products
but 1 thing without read current tag it's possibal?
Dear Ravipatel,
with the REST API, I think it is not possible to keep the old tags while performing a PUT request. However I noticed, that it is possible by using the GraphQL API. There is a mutation to add tags: https://shopify.dev/api/admin-graphql/2021-10/mutations/tagsAdd and it kept the previous tags, when I execute it.
For example:
mutation tagsAdd {
tagsAdd(id: "gid://shopify/Order/<your_order_id>", tags: "Test") {
node {
id
}
userErrors {
field
message
}
}
}
Greetings, Tom
Hi @tommydev,
I'm using the GraphQL API that you've mentioned. But I'm facing the issue while adding tags in languages other than english i.e. japanese & russian. Tags in other languages are not being saved in the order. Have you faced similar issues?
User | RANK |
---|---|
5 | |
4 | |
4 | |
3 | |
3 |