How to remove script files from shopify assets folder when the owner uninstalls the app

Shopify Partner
19 0 5



I have app where we inject script into merchant assets folder. In script file we make ajax call to get some data from our server.


But when merchant uninstalls the app we are not able to delete the script files from the assets folder. So, even after the app is uninstalled script file will make ajax call to our server. So roughly we will be getting more than 50 calls from single merchant who have uninstalled our app, every day. We are able to see the even 1000 calls being made per second. Thsi can badly impact the infrastructure going forward as the customer base increases.

Is there any way to remove script file from the assets folder or stop making ajax call from the script file once the merchant uninstalls our app?



Replies 5 (5)
Shopify Staff
834 99 195

Hey @badgeAppTester_,


When an app is uninstalled, any script tags generated by the app are automatically removed.


I believe this functionality was introduced in 2017, so it's possible that old script tags are still existing if the app was uninstalled before then. Can you confirm when the affected shops originally uninstalled your app?

JB | Developer Support @ Shopify 
 - Was my reply helpful? Click Like to let me know! 
 - Was your question answered? Mark it as an Accepted Solution
 - To learn more visit or the Shopify Web Design and Development Blog

Shopify Partner
19 0 5

We are not using script tags we inserting our script file into assets folder of the store owner. Is there any way to remove script file from the asset folder

15 1 4

Hi, I'm actually having a similar problem.


I used the GraphiQL App to write a mutation for scriptTagCreate so I can test adding in a custom script tag, and after uninstalling the app the script tags are still in my store.



mutation exampleScriptTagCreate($input: ScriptTagInput!) {
  scriptTagCreate(input: $input) {
    userErrors {
    scriptTag {


  "input": {"src": "", "displayScope": "ONLINE_STORE" }

Now I'm trying to figure out how to remove these Script Tags with another Mutation but I'm having trouble doing so.


15 1 4

Doh!! I solved my problem. I was using the GraphiQL App to insert ScriptTags but I was trying to uninstall MY ACTUAL APP and expecting it to work. Uninstalling the GraphiQL App worked like a charm.


Dumb mistake on my part... (I'm new)

4 1 2


Is it possible to remove the Graphql App by API call?