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 = 18(分类ID)
如果还需删除分类:
delete FROM `wp_term_relationships` where term_taxonomy_id = 18(分类ID)
另外,update更新内容的用法:
UPDATE wp_posts SET post_content = replace( post_content, '原内容','新内容') WHERE option_name = 'home' OR option_name ='siteurl';
<?php/*** 将所以已发布的文章别名修改成对应ID,让文章以别名完美连续* PS:备份网站数据库后,请放到WordPress根目录执行,成功后请记得删除!**/require('./wp-blog-header.php');global $wpdb;$wpdb->query("UPDATE $wpdb->posts SET post_name = ID WHERE post_status = 'publish' AND post_type = 'post'");echo 'Update Success!';?>