wloe2gf 发表于 2024-10-28 11:50:07

WordPress照片路径批量替换办法


    <div style="color: black; text-align: left; margin-bottom: 10px;">
      <p style="font-size: 16px; color: black; line-height: 40px; text-align: left; margin-bottom: 15px;">不<span style="color: black;">少许</span>站长在<span style="color: black;">运用</span>WordPress博客<span style="color: black;">或</span><span style="color: black;">搬迁</span>时,需要把WordPress<span style="color: black;">文案</span>中的<span style="color: black;">照片</span>路径进行替换来<span style="color: black;">处理</span><span style="color: black;">照片</span>不<span style="color: black;">表示</span>的问题。总结一下WP<span style="color: black;">照片</span>路径批量替换的过程,方便有此类<span style="color: black;">需要</span>的站长们学习。</p>
      <div style="color: black; text-align: left; margin-bottom: 10px;"><img src="https://p3-sign.toutiaoimg.com/pgc-image/e6eaac9737a740a0b6734b73d27d8dbd~noop.image?_iz=58558&amp;from=article.pc_detail&amp;lk3s=953192f4&amp;x-expires=1729497614&amp;x-signature=sz4aqg4iyeDGv%2FYIy9ijf%2FPC%2Bv8%3D" style="width: 50%; margin-bottom: 20px;"></div>
      <p style="font-size: 16px; color: black; line-height: 40px; text-align: left; margin-bottom: 15px;"><strong style="color: blue;">什么<span style="color: black;">状况</span>下批量替换<span style="color: black;">照片</span>路径</strong></p>
      <p style="font-size: 16px; color: black; line-height: 40px; text-align: left; margin-bottom: 15px;"><strong style="color: blue;">1、更换了网站域名</strong></p>
      <p style="font-size: 16px; color: black; line-height: 40px; text-align: left; margin-bottom: 15px;">有许多网站建设初期都随便<span style="color: black;">选取</span>了一个网站域名,在更新<span style="color: black;">文案</span>的时候,上传<span style="color: black;">照片</span><span style="color: black;">非常多</span>时候都是自带网站域名,<span style="color: black;">因此呢</span>,一旦更换域名的时候,<span style="color: black;">照片</span>链接<span style="color: black;">位置</span>就会失效。</p>
      <p style="font-size: 16px; color: black; line-height: 40px; text-align: left; margin-bottom: 15px;"><strong style="color: blue;">2、外链图床<span style="color: black;">位置</span>失效</strong></p>
      <p style="font-size: 16px; color: black; line-height: 40px; text-align: left; margin-bottom: 15px;">有时候为了节省网站空间,<span style="color: black;">或</span>更新<span style="color: black;">文案</span>的时候<span style="color: black;">无</span><span style="color: black;">太多</span><span style="color: black;">思虑</span>,<span style="color: black;">运用</span>了统一的图床外链,<span style="color: black;">例如</span><span style="color: black;">运用</span>了七牛云存储的二级域名。一旦图床外链失效,有可能是被防盗,有可能是更换了二级域名,<span style="color: black;">那样</span><span style="color: black;">照片</span>的链接<span style="color: black;">位置</span>就会失效。</p>
      <p style="font-size: 16px; color: black; line-height: 40px; text-align: left; margin-bottom: 15px;"><strong style="color: blue;">3、其他原因<span style="color: black;">照片</span><span style="color: black;">位置</span>失效</strong></p>
      <p style="font-size: 16px; color: black; line-height: 40px; text-align: left; margin-bottom: 15px;">以上三种<span style="color: black;">状况</span>,<span style="color: black;">倘若</span>要更换<span style="color: black;">文案</span><span style="color: black;">照片</span>链接<span style="color: black;">位置</span>时,不进行批量式的修改,<span style="color: black;">经过</span>手工修改,除非<span style="color: black;">文案</span>才十篇八篇,那样就无<span style="color: black;">所说</span>,否则将是很难更新<span style="color: black;">照片</span><span style="color: black;">位置</span>。</p>
      <p style="font-size: 16px; color: black; line-height: 40px; text-align: left; margin-bottom: 15px;"><strong style="color: blue;">数据库命令批量替换</strong></p>
      <p style="font-size: 16px; color: black; line-height: 40px; text-align: left; margin-bottom: 15px;"><span style="color: black;">经过</span>MySQL的操作命令语句进行更新Update所有的<span style="color: black;">文案</span>中<span style="color: black;">照片</span>链接<span style="color: black;">位置</span>。</p>
      <p style="font-size: 16px; color: black; line-height: 40px; text-align: left; margin-bottom: 15px;">需要<span style="color: black;">重视</span>的是,新手在操作前<span style="color: black;">必定</span>要备份好数据库,<span style="color: black;">以避免</span>操作错误还有后路可退。<span style="color: black;">怎样</span>备份数据库,<span style="color: black;">这儿</span>就不详说<span style="color: black;">自动</span>在网上搜索<span style="color: black;">关联</span>教程。</p>
      <p style="font-size: 16px; color: black; line-height: 40px; text-align: left; margin-bottom: 15px;">登录自己的数据库管理后台,登录PHPMyadmin数据库管理软件,登陆后台<span style="color: black;">选取</span>对应的数据库wp_posts表,如下图:</p>
      <div style="color: black; text-align: left; margin-bottom: 10px;"><img src="https://p3-sign.toutiaoimg.com/pgc-image/6f9a56c9339e4dfe98bd3ddd5a50050a~noop.image?_iz=58558&amp;from=article.pc_detail&amp;lk3s=953192f4&amp;x-expires=1729497614&amp;x-signature=Xf91h%2F79C9wYZzAZ3t8Pf2kGuIo%3D" style="width: 50%; margin-bottom: 20px;"></div>
      <p style="font-size: 16px; color: black; line-height: 40px; text-align: left; margin-bottom: 15px;">执行SQL命令行操作,输入命令行 UPDATE wp_posts SET post_content = REPLACE( post_content, 旧网址, 新网址 ); 示例如下:</p>
      <p style="font-size: 16px; color: black; line-height: 40px; text-align: left; margin-bottom: 15px;">UPDATE wp_posts SET post_content = REPLACE( post_content, www.jisuseo.top/wp-content/uploads, imgcdn.wuyouseo.cn );</p>
      <div style="color: black; text-align: left; margin-bottom: 10px;"><img src="https://p3-sign.toutiaoimg.com/pgc-image/ebfda2f9af8447a2b11e071c54922ac5~noop.image?_iz=58558&amp;from=article.pc_detail&amp;lk3s=953192f4&amp;x-expires=1729497614&amp;x-signature=Kwa1p%2Fg5mXr03%2Bkfv0C4qFuoC5Q%3D" style="width: 50%; margin-bottom: 20px;"></div>
      <p style="font-size: 16px; color: black; line-height: 40px; text-align: left; margin-bottom: 15px;"><strong style="color: blue;">UPDATE语句命令说明</strong></p>
      <p style="font-size: 16px; color: black; line-height: 40px; text-align: left; margin-bottom: 15px;">UPDATE 表名 SET 字段 = REPLACE(字段,待替换内容,替换值);</p>
      <p style="font-size: 16px; color: black; line-height: 40px; text-align: left; margin-bottom: 15px;">表名和字段名都不需要引号,只是在待替换内容和替换值上是需要引号的,<span style="color: black;">由于</span><span style="color: black;">她们</span>是字符串类型的<span style="color: black;">这儿</span>要<span style="color: black;">重视</span>。</p>
      <p style="font-size: 16px; color: black; line-height: 40px; text-align: left; margin-bottom: 15px;">最后完<span style="color: black;">成为了</span>WordPress<span style="color: black;">文案</span>中<span style="color: black;">照片</span>的批量替换工作。</p>
      <p style="font-size: 16px; color: black; line-height: 40px; text-align: left; margin-bottom: 15px;">本站<span style="color: black;">文案</span>由SEO技术博客撰稿人原创,作者:无 忧创作,如若转载请注明原文及出处:</p>https://www.ainiseo.com/jianzhan/wordpress/5171.html

      <p style="font-size: 16px; color: black; line-height: 40px; text-align: left; margin-bottom: 15px;"><strong style="color: blue;">下面是<span style="color: black;">博主</span>整理的全行业一整套系统的SEO优化秘籍里面有100节SEO真人课程,是<span style="color: black;">咱们</span>团队花费240多天制作的,课程涵盖数十种网站优化<span style="color: black;">办法</span>,课程文件加起来有30G</strong>,<strong style="color: blue;">(关注我私信seo<span style="color: black;">就可</span>领取)</strong></p>
      <div style="color: black; text-align: left; margin-bottom: 10px;"><img src="https://p26-sign.toutiaoimg.com/pgc-image/7744d5d289ba48099ee316cb3e80bf79~noop.image?_iz=58558&amp;from=article.pc_detail&amp;lk3s=953192f4&amp;x-expires=1729497614&amp;x-signature=1tkLj5bZtTy140gmb%2FM3MX7WKlw%3D" style="width: 50%; margin-bottom: 20px;"></div>
    </div>




wrjc1hod 发表于 2024-11-1 19:14:50

谷歌外链发布 http://www.fok120.com/
页: [1]
查看完整版本: WordPress照片路径批量替换办法