WordPress建站使用小技巧
这里将会长期更新WordPress建站使用过程中的遇到的小问题,各种小技巧及遇到问题的处理办法。
如何批量删除文章或草稿回车站内容
答:
- 在SQL框里粘贴以下的SQL语句执行即可。
delete from wp_posts where ID >= 1;
delete from wp_postmeta where meta_id >= 1;
以上一次性删除wordpress所有文章的方法,亲测有效,帮助我们自己做网站节省大量的无用功时间。
补充:
如果想一次性全部清空所有文章和分类,可以使用以下的语句:
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;
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;
清空回收站语句
delete from wp_posts where post_status="trash";
清空草稿语句
delete from wp_posts where post_status="draft";
有时候在wordpress后台执行一些删除/批量类的任务总出错,比如类似:网址为 某某 的网页可能暂时无法连接,或者它已永久性地移动到了新网址。
答:但你尝试各种办法都没法解决的时候,有可能你是宝塔管理的网站,并且安装了防火墙,先把防火墙关闭即可。