这篇教程将帮助你批量更新WordPress文章的状态!从而避免一个一个手动更新。
SQL技巧
UPDATE wp_posts SET post_status = ‘value’ WHERE (post_type =’post’ and post_status = ‘value’) ;
其中value的值包括draft,pending和publish。
SQL实例
将所有状态为draft的文章改为publish。SQL语句如下:
UPDATE wp_posts SET post_status = ‘publish’ WHERE (post_type =’post’ and post_status = ‘draft’) ;
在phpmyadmin中运行上面的代码就可以了!
注意:
1. 先备份数据库
2. 确保SQL语法是正确的
3. 使用正确的文章状态
联系客服