post_type自定义的文章类型,批量删除时,只需要加上where对post_type字段进行判断即可,示例如下:
1、删除自定义文章类型下的所有文章SQL语句,假设该自定义文章类型为my_post
1 | DELETE `wp_posts` FROM `wp_posts` WHERE `post_type` LIKE 'my_post' |
2、对于自定义文章类型,删除指定时间段内该文章类型下的文章SQL语句
1 | DELETE `wp_posts` FROM `wp_posts` WHERE `post_date` BETWEEN '2022-01-19 02:43:41.000000' AND '2022-01-19 02:43:41.000000' AND `post_type` LIKE 'my_post' |
原文链接:https://xiaohost.com/10518.html,转载请注明出处。
评论0