4

WordPress 一次性批量删除所有文章

 2 years ago
source link: https://uzbox.com/tech/wordpress-dell.html
Go to the source link to view the article. You can view the picture content, updated content and better typesetting reading experience. If the link is broken, please click the button below to view the snapshot at that time.
neoserver,ios ssh client

WordPress批量删除文章

在wordpress中如何批量删除所有文章?有几种方法可以删除掉所有文章,一种是重新安装wordpress,删除的彻底,所有插件都需要重新下载,重新设置,比较麻烦。还有一种就是在wordpress安装设置完毕后,安装一个UpdraftPlus的备份插件,将配置好的wordpress备份,需要恢复的时候,一键还原就可以了。

7b30a5adc645ffa3c00c635585bd2f0c-1024x291.png

但是有很多初次接触wordpress的网友,没有备份空白数据库,也不想重新安装wordpress,那么怎么可以批量删除掉之前发表过的文章呢?如果数量小的话,手工在后台删除就可以了,如果是成千上万的话,怎么才能一次性删除干净呢?

下面教大家,如果使用SQL语句进行批量删除。

首先在phpmyadmin中,打开你wordpress的数据库,点击SQL选项,运行SQL查询。

c7b29468cf9326a9a1d0229d8ea2d240-1024x380.png

下面是一次性删除wordpress所有文章的SQL语句:

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;

About Joyk


Aggregate valuable and interesting links.
Joyk means Joy of geeK