织梦后台SQL批量修改文章标签语法

2019-10-24,,

使用DedeCMS建站会遇到这样的问题,采集来的文章有个小错误没修正,需要把文章的内容批量替换下,一篇一篇的修改会十分麻烦,这里就需要用到织梦的特有功能,SQL批量替换功能,语法标签如下:

  1.更改文章中的内容

update dede_addonarticle set body=replace(body,'原来的字符','替换后的字符')

  例子解释:update dede_addonarticle set body=replace(body,'软件下载','插件下载')

 

  2.更改缩略图目录

update dede_archives set litpic=replace(litpic,'原来的字符','替换后的字符')

  例子解释:update dede_archives set litpic=replace(litpic,'uplimg,'tupian')

 

  3.批量替换文章模型中内容部分图片链接路径

update dede_addonarticle set body=replace(body,'src="http://dede58.com/img/','src="http://dede58.com/images/');

  例子解释:把图片路径由原来的http://www.dede58.com/img/替换成http://dede58.com/images/

 

  4.批量替换文章模型中内容部分超链接

update dede_addonarticle set body=replace(body,'href="http://www.meiowpet.com','href="http://meiowpet.com');

  例子解释:把文章模型中的超链接由原来的http://www.yudouyudoucom替换成http://yudouyudoucom

 

  5.批量替换文章模型中内容部分图片锚文本文字

update dede_addonarticle set body=replace(body,'alt="http://www.dede58.com/','alt="http://dede58.com/');

  例子解释:把文章模型中的图片锚文本信息由原来的http://www.dede58.com替换成http://dede58.com

 

  6.批量替换软件模型内容部分超链接

update dede_addonsoft set introduce=replace(introduce,'href="http://www.dede58.com/images/js/test.html','href="http:/dede58.com/index.html');

  例子解释:把软件模型内容中超链接由原来的http://www.dede58.com/images/js/test.html替换成http:/yudouyudoucom/index.htm

 

  7.批量替换文章模型中作者字段

update dede_archives set writer=replace(writer,'http://www.dede58.com','http://dede58.com');

  例子解释:把文章模型中的作者由原来的http://www.dede58.com替换成http://dede58.com

 

  8.批量替换文章模型中来源字段

 

update dede_archives set source=replace(source,'69阁www.dede58.com','织梦58dede58.com');;

  例子解释:把文章模型中的帖子来源由原来的69阁www.dede58.com替换成织梦58dede58.com

 

  9.批量替换文章命名规则

update `dede_arctype` set namerule='{typedir}/{aid}.html';

  例子解释:把站内所有文章模型命名规则全部替换成{typedir}/{aid}.html这样一种形式

 

  10.批量替换软件模型演示地址超链接

update dede_addonsoft set writer=replace(officialUrl,'http:/www.dede58.com','http://dede58.com');

  例子解释:把软件模型原始地址超链接由原来的http:/www.dede58.com替换成http://dede58.com

 

  11.批量审核文章

update dede_archives set arcrank=0;

  例子解释:arcrank=0 仅动态。

《织梦后台SQL批量修改文章标签语法.doc》

下载本文的Word格式文档,以方便收藏与打印。