- 进入网站空间后台,点击数据库管理,在SQL框中,粘贴以下SQL语句。
- 在SQL框里粘贴以下的SQL语句执行即可。
1 2 | delete from wp_posts where ID >= 1; delete from wp_postmeta where meta_id >= 1; |
上述是一次性删除wordpress所有文章的方法,个人测试有效,帮助我们自己做网站,节省大量的无用功时间。
WordPress批量删除所有文章和分类
如果想一次性全部清空所有文章和分类,可以使用以下的语句:
1 2 3 4 5 6 | DELETE FROM wp_posts WHERE ID >= 1; DELETE FROM wp_postmeta WHERE meta_id >= 1; DELETE FROM wp_term_relationships WHERE object_id >= 1; DELETE FROM wp_term_taxonomy WHERE term_id >= 1; DELETE FROM wp_terms WHERE term_id >= 1; DELETE FROM wp_termmeta WHERE meta_id >= 1; |
清空回收站语句
1 | DELETE FROM wp_posts WHERE post_status=”trash”; |
清空草稿语句
1 | DELETE FROM wp_posts WHERE post_status=”draft”; |
注意事项:页面内容也在post里面存储着,如果用sql也会把页面里面的内容删掉,慎用!!!