WordPress

SQL批量修改wordpress文章的标题和内容

#根据ID查标题和内容
select wp.post_title,wp.post_content from wp_posts wp where wp.ID=8807;


#改内容
UPDATE wp_posts SET wp_posts.post_content=REPLACE (wp_posts.post_content,'old_string','new_string') WHERE wp_posts.post_type="post" AND wp_posts.post_status="publish";


  # 改标题
UPDATE wp_posts SET wp_posts.post_title=REPLACE (wp_posts.post_title," old_string","new_string") WHERE wp_posts.post_type="post" AND wp_posts.post_status="publish";

 

(0)

本文由 SilenceLee的学习笔记 作者:silencelee 发表,转载请注明来源!

热评文章

发表评论

解决 : *
18 ⁄ 6 =