wordpress数据库中批量修改文章内容和标题

内容替换方法

SELECT * FROM wp_posts WHERE post_content LIKE ‘%你的要替换的文本%’

SELECT * FROM wp_posts WHERE post_content LIKE ‘%薇晓兰%’

UPDATE wp_posts SET post_content = REPLACE(post_content,’old’,’new’)

UPDATE wp_posts SET post_content = REPLACE(post_content,’薇晓兰’,’老张’)

标题替换方法

SELECT * FROM wp_posts WHERE post_title LIKE ‘%你的要替换的文本%’

SELECT * FROM wp_posts WHERE post_title LIKE ‘%薇晓兰%’

UPDATE wp_posts SET post_title = REPLACE(post_title,’old’,’new’)

UPDATE wp_posts SET post_title = REPLACE(post_title,’薇晓兰’,’老张’)

受此启发,那么修改摘要excert和元数据metadata等也可以在数据库中更新

转载请注明本文链接:https://blog.weixiaoline.com/250.html

发表评论

您的电子邮箱地址不会被公开。