sql命令批量更改替换WP网站post_content蓝奏网盘的链接
蓝奏网盘换链接以后,针对之前分享的链接应该如何替换?
这里用简单的sql数据库命令进行替换,因为之前的链接全在wp_posts表里面的post_content字段中,所以我们需要对post_content中含有lanzous.com的记录进行替换。
首先找出内容里面有蓝奏网盘链接的id
select id FROM wp_posts where post_content LIKE "%lanzous.com%" AND post_status="publish"
对含有蓝奏网盘链接id的
update wp_posts set post_content = replace(post_content,"lanzous","lanzouw") where id in (select id FROM wp_posts where post_content LIKE "%lanzous.com%" AND post_status="publish")
如果指定id进行更改,执行以下命令即可:
update wp_posts set post_content = replace(post_content,"lanzous","lanzouw") where id IN (11344,58389, 58393, 58396, 58404, 58885)
评论