Dedecms sql命令批量修改内容

今天要修改一个网站的栏目命名方法,因为网站的文章数目太多了,为了方便管理和优化把栏目尽量的扁平化简单化,就要修改dedecms生成页面的命名方法,100多个栏目一个一个改要改多久啊,TC就从网上找了一个sql批量修改命名的方法,随便也把其他dedecms sql命名方法也发上来:

select namerule from dede_arctype

select namerule2 from dede_arctype

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

update dede_arctype set namerule2='{typedir}/list_{page}.html'

利用SQL命令批量修改内容,路径和超链接等信息。

语句 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://zuola.net/img/','src="http://zuola.net/images/');

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

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

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

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

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

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

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

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

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

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

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

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

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

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

update dede_archives set source=replace(source,'做啦www.zuola.net','星辰似水zuola.net');

例子解释:把文章模型中的帖子来源由原来的做啦www.zuola.net替换成星辰似水zuola.net

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

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

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

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

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

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

11.批量审核文章

update dede_archives set arcrank=0;

update dede_arctiny set arcrank=0;

update dede_taglist set arcrank=0;

例子解释:arcrank=0 仅动态