%title缩略图

WordPress一次性清空回收站的办法

WordPress回收站里有很多陈旧文章或者草稿,此时需要删除手动很花费时间,而且很累,通过数据库SQL命令,我们来轻松完成。

解决办法:

登录数据库管理后台,找到网站对应的数据库,在SQL中输入并执行以下语句:

delete from wp_posts where post_status="trash";

此外,一次性删除文章草稿的SQL语句为:

delete from wp_posts where post_status="draft";

如果想批量删除所有文章或者草稿:

delete
from
wp_posts
using
wp_posts,
wp_term_relationships,
wp_term_taxonomy
where
wp_posts.id=wp_term_relationships.object_id
and
wp_term_relationships.term_taxonomy_id = wp_term_taxonomy.term_taxonomy_id
and
wp_term_relationships.term_taxonomy_id = 1

提示:操作数据库前,记得备份数据库,安全首要。

发表回复

您的电子邮箱地址不会被公开。 必填项已用*标注

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <s> <strike> <strong>

1 × 1 =

此站点使用Akismet来减少垃圾评论。了解我们如何处理您的评论数据