有时我们需要将一个网站搬迁到另一个服务器。我们只想保留网站的模板样式,而不需要文章内容。一般情况下我们可以在后台删除已发表的文章,但如果有很多文章,我们则需要一次删除所有文章。
WordPress如何批量删除所有文章
- 进入网站空间后台,点击数据库管理,在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”;
|
声明:本站标注原创发布或特殊说明内容。任何个人或组织,在未征得本站同意时,禁止复制、盗用、采集、发布本站内容到任何网站及平台。未标注原创内容来源于公开的网络或由用户分享,如若本站内容侵犯了原著者的合法权益,可联系我们进行处理。
All content on this website are from the network, if inadvertently violated your copyright (or interest), please email letter to tell us will be removed as soon as possible
All content on this website are from the network, if inadvertently violated your copyright (or interest), please email letter to tell us will be removed as soon as possible
评论(0)