--- title: scriptTagDelete - GraphQL Admin description: |-

Theme app extensions

If your app integrates with a Shopify theme and you plan to submit it to the Shopify App Store, you must use theme app extensions instead of Script tags. Script tags can only be used with vintage themes. Learn more.

Script tag deprecation

Script tags will be sunset for the Order status page on August 28, 2025. Upgrade to Checkout Extensibility before this date. Shopify Scripts will continue to work alongside Checkout Extensibility until August 28, 2025.

Deletes a script tag. api_version: 2025-10 api_name: admin type: mutation api_type: graphql source_url: html: https://shopify.dev/docs/api/admin-graphql/latest/mutations/scripttagdelete md: https://shopify.dev/docs/api/admin-graphql/latest/mutations/scripttagdelete.md --- # script​Tag​Delete mutation Requires `write_script_tags` access scope. Theme app extensions If your app integrates with a Shopify theme and you plan to submit it to the Shopify App Store, you must use theme app extensions instead of Script tags. Script tags can only be used with vintage themes. [Learn more](https://shopify.dev/apps/online-store#what-integration-method-should-i-use). Script tag deprecation Script tags will be sunset for the **Order status** page on August 28, 2025. [Upgrade to Checkout Extensibility](https://www.shopify.com/plus/upgrading-to-checkout-extensibility) before this date. [Shopify Scripts](https://shopify.dev/docs/api/liquid/objects#script) will continue to work alongside Checkout Extensibility until August 28, 2025. Deletes a script tag. ## Arguments * id [ID!](https://shopify.dev/docs/api/admin-graphql/latest/scalars/ID) required The ID of the script tag to delete. *** ## Script​Tag​Delete​Payload returns * deleted​Script​Tag​Id [ID](https://shopify.dev/docs/api/admin-graphql/latest/scalars/ID) The ID of the deleted script tag. * user​Errors [\[User​Error!\]!](https://shopify.dev/docs/api/admin-graphql/latest/objects/UserError) non-null The list of errors that occurred from executing the mutation. *** ## Examples * ### Deletes a script tag #### Query ```graphql mutation ScriptTagDelete($id: ID!) { scriptTagDelete(id: $id) { deletedScriptTagId userErrors { field message } } } ``` #### Variables ```json { "id": "gid://shopify/ScriptTag/421379493" } ``` #### cURL ```bash curl -X POST \ https://your-development-store.myshopify.com/admin/api/2025-10/graphql.json \ -H 'Content-Type: application/json' \ -H 'X-Shopify-Access-Token: {access_token}' \ -d '{ "query": "mutation ScriptTagDelete($id: ID!) { scriptTagDelete(id: $id) { deletedScriptTagId userErrors { field message } } }", "variables": { "id": "gid://shopify/ScriptTag/421379493" } }' ``` #### React Router ```javascript import { authenticate } from "../shopify.server"; export const loader = async ({request}) => { const { admin } = await authenticate.admin(request); const response = await admin.graphql( `#graphql mutation ScriptTagDelete($id: ID!) { scriptTagDelete(id: $id) { deletedScriptTagId userErrors { field message } } }`, { variables: { "id": "gid://shopify/ScriptTag/421379493" }, }, ); const json = await response.json(); return json.data; } ``` #### Ruby ```ruby session = ShopifyAPI::Auth::Session.new( shop: "your-development-store.myshopify.com", access_token: access_token ) client = ShopifyAPI::Clients::Graphql::Admin.new( session: session ) query = <<~QUERY mutation ScriptTagDelete($id: ID!) { scriptTagDelete(id: $id) { deletedScriptTagId userErrors { field message } } } QUERY variables = { "id": "gid://shopify/ScriptTag/421379493" } response = client.query(query: query, variables: variables) ``` #### Node.js ```javascript const client = new shopify.clients.Graphql({session}); const data = await client.query({ data: { "query": `mutation ScriptTagDelete($id: ID!) { scriptTagDelete(id: $id) { deletedScriptTagId userErrors { field message } } }`, "variables": { "id": "gid://shopify/ScriptTag/421379493" }, }, }); ``` #### Response ```json { "scriptTagDelete": { "deletedScriptTagId": "gid://shopify/ScriptTag/421379493", "userErrors": [] } } ``` * ### scriptTagDelete reference [Open in GraphiQL](http://localhost:3457/graphiql?query=mutation%20ScriptTagDelete\(%24id%3A%20ID!\)%20%7B%0A%20%20scriptTagDelete\(id%3A%20%24id\)%20%7B%0A%20%20%20%20deletedScriptTagId%0A%20%20%20%20userErrors%20%7B%0A%20%20%20%20%20%20field%0A%20%20%20%20%20%20message%0A%20%20%20%20%7D%0A%20%20%7D%0A%7D\&variables=%7B%0A%20%20%22id%22%3A%20%22gid%3A%2F%2Fshopify%2FScriptTag%2F421379493%22%0A%7D) ```javascript import { authenticate } from "../shopify.server"; export const loader = async ({request}) => { const { admin } = await authenticate.admin(request); const response = await admin.graphql( `#graphql mutation ScriptTagDelete($id: ID!) { scriptTagDelete(id: $id) { deletedScriptTagId userErrors { field message } } }`, { variables: { "id": "gid://shopify/ScriptTag/421379493" }, }, ); const json = await response.json(); return json.data; } ``` ##### GQL ``` mutation ScriptTagDelete($id: ID!) { scriptTagDelete(id: $id) { deletedScriptTagId userErrors { field message } } } ``` ##### cURL ``` curl -X POST \ https://your-development-store.myshopify.com/admin/api/2025-10/graphql.json \ -H 'Content-Type: application/json' \ -H 'X-Shopify-Access-Token: {access_token}' \ -d '{ "query": "mutation ScriptTagDelete($id: ID!) { scriptTagDelete(id: $id) { deletedScriptTagId userErrors { field message } } }", "variables": { "id": "gid://shopify/ScriptTag/421379493" } }' ``` ##### React Router ``` import { authenticate } from "../shopify.server"; export const loader = async ({request}) => { const { admin } = await authenticate.admin(request); const response = await admin.graphql( `#graphql mutation ScriptTagDelete($id: ID!) { scriptTagDelete(id: $id) { deletedScriptTagId userErrors { field message } } }`, { variables: { "id": "gid://shopify/ScriptTag/421379493" }, }, ); const json = await response.json(); return json.data; } ``` ##### Node.js ``` const client = new shopify.clients.Graphql({session}); const data = await client.query({ data: { "query": `mutation ScriptTagDelete($id: ID!) { scriptTagDelete(id: $id) { deletedScriptTagId userErrors { field message } } }`, "variables": { "id": "gid://shopify/ScriptTag/421379493" }, }, }); ``` ##### Ruby ``` session = ShopifyAPI::Auth::Session.new( shop: "your-development-store.myshopify.com", access_token: access_token ) client = ShopifyAPI::Clients::Graphql::Admin.new( session: session ) query = <<~QUERY mutation ScriptTagDelete($id: ID!) { scriptTagDelete(id: $id) { deletedScriptTagId userErrors { field message } } } QUERY variables = { "id": "gid://shopify/ScriptTag/421379493" } response = client.query(query: query, variables: variables) ``` ## Input variables JSON ```json { "id": "gid://shopify/ScriptTag/421379493" } ``` ## Response JSON ```json { "scriptTagDelete": { "deletedScriptTagId": "gid://shopify/ScriptTag/421379493", "userErrors": [] } } ```