DedeCMS后台SQL批量修改文章标签的语法

网站使用DedeCMS系统建站,如果需要批量修改发布过的内容,可以一篇一篇的修改,但是数量大了修改起来会很浪费时间。其实我们只需要使用下面的SQL批修改命令,把需要修改的文章的内容批量替换下,参考如下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://aizici.com/img/','src="http://aizici.com/images/');

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

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

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

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

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

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

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

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

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

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

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

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

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

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

update dede_archives set source=replace(source,'爱资源www.aizici.com','爱字词aizici.com');;

  例子解释:把文章模型中的帖子来源由原来的:爱资源www.aizici.com替换成爱字词aizici.com

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

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

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

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

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

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

11.批量审核文章

update dede_archives set arcrank=0;

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