我有一个数据库50,000 articles
, 我的一个类别包含post of 30k
, 我错误地删除了一个包含30000篇帖子的类别,但所有帖子仍然存在。
我已经在google上搜索了2天了,但我仍然找不到方法将这30k移动到我刚刚创建的新类别。
请帮帮我,我有权限访问PHPMyAdmin
INSERT IGNORE INTO wp_term_relationships
(object_id, term_taxonomy_id)
(
SELECT DISTINCT ID, 3
FROM wp_posts
WHERE post_type = \'post\' AND post_status = \'publish\'
);
我发现上面的代码很有用,但它会移动ALL the posts of the entire site 对于一个类别,我只需要删除的帖子