Tutorial

从 Shopify 商店删除所有内容

手动清理 Shopify 商店可能非常耗时且容易出错。DataEase 让这一过程变得简单:导出您的数据,为每种实体类型准备删除操作,并通过验证批量删除所有内容——同时遵循正确的操作顺序。

🎯 目标

通过使用 CSV/Excel 和 DataEase 删除(或在无法删除时存档)关键实体的数据来清理 Shopify 商店。


⚠️ Shopify 的重要限制

  • 无法删除实时订单 — 只能取消(存档)
  • 有订单的客户无法删除,直到订单被取消关联或取消且客户不再被引用
  • 删除是不可逆的。 在开始之前始终保留完整的备份导出

📋 推荐的操作顺序

  1. 订单 — 取消(存档)实时订单;删除草稿订单
  2. 客户 — 如有需要,先将客户与订单取消关联(访客订单),然后删除没有订单的客户
  3. 公司 (B2B) — 删除公司,然后删除其联系人/位置(或直接删除订单项)
  4. 产品和变体 — 删除产品(移除变体/媒体)或删除特定变体
  5. 集合 — 删除您不再需要的手动/自动集合
  6. 内容 — 删除页面、博客/文章、评论、菜单
  7. 目录附加项 — 删除折扣、重定向、文件、metaobjects、翻译(按资源/语言)

提示: 使用过滤器(日期范围、标签、Collection ID、库存位置等)精确定位您想要删除的内容。


🔧 如何按实体删除/存档

订单(实时)

操作: action = CANCEL(存档订单)

id,action
gid://shopify/Order/123,CANCEL

草稿订单

操作: command = DELETE

id,command
gid://shopify/DraftOrder/789,DELETE

将客户与订单取消关联(可选准备)

操作: command = UPDATE 并清除 customerId(使其成为访客订单)

id,command,customerId
gid://shopify/Order/123,UPDATE,

客户

规则: 客户必须没有关联订单

操作: command = DELETE

id,command
gid://shopify/Customer/555,DELETE

公司 (B2B)

公司行: command = DELETE

联系人/位置行: itemCommand = DELETE(当特定删除订单项时)

CSV(公司):

id,command
gid://shopify/Company/111,DELETE

CSV(联系人或位置行):

id,topRow,itemCommand,contactId
gid://shopify/Company/111,FALSE,DELETE,gid://shopify/CompanyContact/999

产品(删除变体和媒体)

操作: command = DELETE

id,command
gid://shopify/Product/123,DELETE

变体(保留产品,移除特定变体)

操作: variantCommand = DELETE

variantId,variantCommand
gid://shopify/ProductVariant/111,DELETE

集合

操作: command = DELETE

id,command
gid://shopify/Collection/222,DELETE

页面

操作: command = DELETE

id,command
gid://shopify/Page/333,DELETE

博客和文章

先删除文章,然后删除博客(如果您的工作流程支持级联)

CSV(文章):

id,command
gid://shopify/Article/444,DELETE

CSV(博客):

id,command
gid://shopify/Blog/445,DELETE

评论(关于文章)

操作: command = DELETE

id,command
gid://shopify/Comment/556,DELETE

菜单(导航)

操作: command = DELETE

id,command
gid://shopify/Menu/777,DELETE

文件(设置 → 文件)

操作: command = DELETE

注意: 删除被主题/页面引用的文件将破坏图像/链接

id,command
gid://shopify/MediaImage/888,DELETE

重定向

操作: command = DELETE(需要 ID)

id,command
gid://shopify/UrlRedirect/999,DELETE

折扣

操作: command = DELETE

id,command
gid://shopify/DiscountAutomatic/1234,DELETE

Metaobjects

操作: command = DELETE

id,command
gid://shopify/Metaobject/abc,DELETE

翻译

操作: command = DELETE 按语言/值(从资源中移除翻译)

CSV(移除法语翻译):

resourceId,command,[fr] value
gid://shopify/Product/123,DELETE,

💡 最佳实践

  • 备份所有内容: 运行完整导出(Products, Variants, Collections, Customers, Orders, Draft Orders, Discounts, Redirects, Files, Metaobjects, Blogs, Articles, Comments, Pages, Menus, Translations, Companies)
  • 从小样本开始, 验证,查看结果,然后扩大规模
  • 优先使用 ID 进行匹配; 仅在唯一时使用 handles/SKUs
  • 保留审核文件(验证报告 + 结果)以便合规

🎉 就这样!

您的商店清理现已完成。
如果您遇到任何问题或有疑问,请随时联系我们的支持团队。