← back to Designer Wallcoverings
Remove banned standalone Wallpaper tag from 21 FallingStar Studio products via tagsRemove
2b88a21b80481638ec0cd39835d7f048be31a3b0 · 2026-06-21 13:35:31 -0700 · steve@designerwallcoverings.com
Files touched
A shopify/scripts/data/today-audit-2026-06-21/remove-wallpaper-tag.js
Diff
commit 2b88a21b80481638ec0cd39835d7f048be31a3b0
Author: steve@designerwallcoverings.com <steve@designerwallcoverings.com>
Date: Sun Jun 21 13:35:31 2026 -0700
Remove banned standalone Wallpaper tag from 21 FallingStar Studio products via tagsRemove
---
.../today-audit-2026-06-21/remove-wallpaper-tag.js | 51 ++++++++++++++++++++++
1 file changed, 51 insertions(+)
diff --git a/shopify/scripts/data/today-audit-2026-06-21/remove-wallpaper-tag.js b/shopify/scripts/data/today-audit-2026-06-21/remove-wallpaper-tag.js
new file mode 100644
index 00000000..bba8cb05
--- /dev/null
+++ b/shopify/scripts/data/today-audit-2026-06-21/remove-wallpaper-tag.js
@@ -0,0 +1,51 @@
+// Remove ONLY the standalone "Wallpaper" tag from the 21 FallingStar Studio products.
+// Reversible + idempotent via Shopify Admin API tagsRemove. Touches nothing else.
+// DRY-RUN by default; pass --apply to mutate.
+const https=require("https"),fs=require("fs"),os=require("os");
+const APPLY=process.argv.includes("--apply");
+const env=fs.readFileSync(os.homedir()+"/Projects/secrets-manager/.env","utf8");
+const TOKEN=(env.match(/^SHOPIFY_ADMIN_TOKEN=(.*)$/m)||[])[1].replace(/['"]/g,"").trim();
+const STORE="designer-laboratory-sandbox.myshopify.com",API="2024-10";
+const sleep=ms=>new Promise(r=>setTimeout(r,ms));
+
+const SKUS=["FS-W1002-03","FS-W1005-03","FS-W1005-02","FS-W1005-01","FS-W1004-03","FS-W1004-02","FS-W1004-01","FS-W1003-01","FS-W1003-03","FS-W1002-02","FS-W1002-01","FS-DP-W1006-03","FS-DP-W1006-02","FS-DP-W1006-01","FS-DP-W1010-03","FS-DP-W1010-02","FS-DP-W1010-01","FS-DP-W1009-01","FS-DP-W1008-02","FS-DP-W1008-03","FS-DP-W1008-01"];
+const isBare=t=>t.trim().toLowerCase()==="wallpaper"; // exactly the standalone token, not compound
+
+function gql(q,v={}){return new Promise((res,rej)=>{const b=JSON.stringify({query:q,variables:v});
+const r=https.request({host:STORE,path:`/admin/api/${API}/graphql.json`,method:"POST",headers:{"Content-Type":"application/json","X-Shopify-Access-Token":TOKEN,"Content-Length":Buffer.byteLength(b)}},x=>{let d="";x.on("data",c=>d+=c);x.on("end",()=>{try{res(JSON.parse(d))}catch(e){rej(d)}})});r.on("error",rej);r.write(b);r.end();});}
+async function gqlR(q,v={},t=5){for(let i=0;i<t;i++){let r;try{r=await gql(q,v)}catch(e){r={errors:[{message:String(e).slice(0,160)}]}}if(r&&!r.errors)return r;await sleep(1500*(i+1));}return gql(q,v);}
+
+// Resolve each SKU to a product GID + LIVE tags via variant SKU search.
+const Q_BYSKU=`query($q:String!){productVariants(first:5,query:$q){edges{node{sku product{id title tags}}}}}`;
+const M_REMOVE=`mutation($id:ID!,$tags:[String!]!){tagsRemove(id:$id,tags:$tags){userErrors{field message}}}`;
+
+(async()=>{
+ console.log(`${APPLY?"🔴 LIVE":"DRY-RUN"} — remove standalone "Wallpaper" tag from ${SKUS.length} SKUs`);
+ let hadTag=0,removed=0,errs=0,notFound=0,didntHave=0;
+ const verifyFail=[];
+ for(const sku of SKUS){
+ const r=await gqlR(Q_BYSKU,{q:`sku:${sku}`});
+ const edges=r.data?.productVariants?.edges||[];
+ const match=edges.find(e=>e.node.sku===sku);
+ if(!match){notFound++;console.log(`NOTFOUND ${sku}`);continue;}
+ const prod=match.node.product;
+ const tags=prod.tags||[];
+ const bare=tags.filter(isBare);
+ if(bare.length===0){didntHave++;console.log(`SKIP ${sku} — no standalone Wallpaper tag (tags: ${tags.join(", ")})`);continue;}
+ hadTag++;
+ if(!APPLY){console.log(`WOULD-REMOVE ${sku} — remove ${JSON.stringify(bare)} (keeps ${tags.filter(t=>!isBare(t)).join(", ")})`);continue;}
+ const m=await gqlR(M_REMOVE,{id:prod.id,tags:bare});
+ const ue=m.data?.tagsRemove?.userErrors||[];
+ if(ue.length){errs++;console.log(`ERR ${sku} ${JSON.stringify(ue)}`);continue;}
+ await sleep(150);
+ // verify live
+ const v=await gqlR(Q_BYSKU,{q:`sku:${sku}`});
+ const vp=(v.data?.productVariants?.edges||[]).find(e=>e.node.sku===sku)?.node.product;
+ const still=(vp?.tags||[]).some(isBare);
+ if(still){verifyFail.push(sku);console.log(`VERIFY-FAIL ${sku} still has Wallpaper`);}
+ else{removed++;console.log(`OK ${sku} — removed (now: ${(vp?.tags||[]).join(", ")})`);}
+ await sleep(120);
+ }
+ console.log(`\nDONE — hadTag=${hadTag} removed=${removed} errs=${errs} notFound=${notFound} didntHave=${didntHave} verifyFail=${verifyFail.length}`);
+ if(verifyFail.length)console.log("VERIFY-FAILS:",verifyFail.join(", "));
+})();
← d08bb809 trending: persist status field into REMOVE/KEEP rows (vp-dw-
·
back to Designer Wallcoverings
·
Zoffany title audit (2026-06-21): clean redundant colorway o 54abca22 →