WP CLI 命令从特定类别中删除产品?

发布于 2025-01-20 07:12:25 字数 323 浏览 2 评论 0原文

What的命令

DELETE ALL CATEGORIES IS - wp term list product_cat --field=term_id | xargs wp term delete product_cat

AND

DELETE ALL THE PRODUCTS IS - wp post list —field=ID —post_type=product | xargs wp post delete —force

是从特定类别中选择产品并删除它们的命令。

非常感谢帮助。

While the command to

DELETE ALL CATEGORIES IS - wp term list product_cat --field=term_id | xargs wp term delete product_cat

AND

DELETE ALL THE PRODUCTS IS - wp post list —field=ID —post_type=product | xargs wp post delete —force

what would be the command to select products from a specific category/categories and delete them.

Help much appreciated.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

听你说爱我 2025-01-27 07:12:26

您可以使用类别说明符--category="您的类别"

例如wp post delete $(wp wc Product list --user=1 --format=ids --category=64) --force

You use the category specifier --category="your category".

For example wp post delete $(wp wc product list --user=1 --format=ids --category=64) --force.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文