1.将所有草稿状态的文章全部改为发布状态

update wp_posts set post_status = ‘publish’ WHERE post_status = ‘draft’

 

2.删除所有草稿文章和自动保存的文章

delete from wp_posts where (post_status=’auto-draft’ or post_status=’inherit’) and post_type=’post’

 

3.批量修改文章的发布时间

update wp_posts set post_status = replace(post_date, ‘2017’, ‘2016’) WHERE post_status = ‘draft’ (将所有符合条件的文章的2017年改为2016年)
update wp_posts set post_date = replace(post_date, ‘0000-00-00 00:00:00’, ‘0000-00-00 00:00:00’);  (修改年月日用)