站点图标 度崩网-几度崩溃

MYSQL数据库操作代码记录

1、Wordpress文章数据库批量修改分类

UPDATE wp_term_relationships set term_taxonomy_id = '新分类id'
WHERE term_taxonomy_id = '旧分类id'

2、添加一个隐藏内容短代码外包裹评论可见短代码;注意,删除代码中的“删除

批量修改sql语句

UPDATE wp_posts SET post_content = replace(post_content, "[/content_hide删除]", "[/删除content_hide][/删除reply]");
UPDATE wp_posts SET post_content = replace(post_content, "[content_hide删除]", "[删除reply][删除content_hide]");

修改回去

UPDATE wp_posts SET post_content = replace(post_content, "[/删除content_hide][/删除reply]", "[/删除content_hide]");
UPDATE wp_posts SET post_content = replace(post_content, "[reply删除][删除content_hide]", "[删除content_hide]");