利用mysql批量替换wordpress文章内容/图片路径

比如我要替换文章内容中涉及到的图片路径:

原来文章中图片路径地址:https://www.4spaces.org/iwwenbo/wp-content/uploads/2018/07/outlook-reliefJet-2.jpg
新的文章中图片路径地址:https://www.4spaces.org/wp-content/uploads/2018/07/outlook-reliefJet-2.jpg

替换SQL如下:

UPDATE wp_posts
SET post_content = REPLACE (
    post_content,
    'https://www.4spaces.org/iwwenbo/wp-content/',
    'https://www.4spaces.org/wp-content/'
);



UPDATE wp_posts
SET post_content_filtered = REPLACE (
    post_content_filtered,
    'https://www.4spaces.org/iwwenbo/wp-content/',
    'https://www.4spaces.org/wp-content/'
);

其中wp_posts是你的wordpress数据库中对应的文章内容表名。

© 版权声明
THE END
喜欢就支持一下吧
点赞0 分享
评论 抢沙发

请登录后发表评论

    暂无评论内容