相信你已经备份了wordpress数据库。不管怎样,正如文章所建议的,首先用select语句看看返回了哪些帖子是值得的:
SELECT DISTINCT ID, post_title, post_type, post_status, d.taxonomy, e.name
FROM wp_posts a
LEFT JOIN wp_term_relationships b ON ( a.ID = b.object_id )
LEFT JOIN wp_postmeta c ON ( a.ID = c.post_id )
LEFT JOIN wp_term_taxonomy d ON ( d.term_taxonomy_id = b.term_taxonomy_id )
LEFT JOIN wp_terms e ON ( e.term_id = d.term_id )
WHERE d.taxonomy = \'estate_agents\' AND a.post_type = \'os_estate\' AND e.term_id = 9098
然后,如果你高兴:
DELETE a,b,c
FROM wp_posts a
LEFT JOIN wp_term_relationships b ON ( a.ID = b.object_id )
LEFT JOIN wp_postmeta c ON ( a.ID = c.post_id )
LEFT JOIN wp_term_taxonomy d ON ( d.term_taxonomy_id = b.term_taxonomy_id )
LEFT JOIN wp_terms e ON ( e.term_id = d.term_id )
WHERE d.taxonomy = \'estate_agents\' AND a.post_type = \'os_estate\' AND e.term_id = 9098
指定
DELETE a,b,c
表示仅删除wp\\U POST、wp\\U term\\U关系和wp\\U POSTETA表中的行;wp\\U term\\u分类法(d)和wp\\U terms(e)中的行将不会。