我们运营论坛网站时,如果网站中已经发了很多文章内容了,需要修改替换固定的内容。手动修改耗时,是不可取的。批量替换标题或内容就需要使用SQL批量操作。在此分享,Discuz 如何批量修改门户文章标题及内容。

Discuz 批量替换/修改门户文章标题、内容 SQL命令:

批量替换门户文章标题:
UPDATE pre_portal_article_content SET content=REPLACE(subject,’替换前’,’替换后’);

批量替换门户文章内容:
UPDATE pre_portal_article_content SET content=REPLACE(content,’替换前’,’替换后’);

批量替换论坛贴子标题:
UPDATE pre_forum_thread SET subject=REPLACE(subject,’替换前,’替换后’);

批量替换论坛贴子内容:
UPDATE pre_forum_post SET message=REPLACE(message,’替换前’,’替换后’);

举例:
UPDATE pre_portal_article_content SET content=REPLACE(content,'<div><embed’,'<div><embed tt’);
UPDATE pre_portal_article_content SET content=REPLACE(content,’height=”500″>’,’height=”tt500″>’);

UPDATE pre_portal_article_content SET content=REPLACE(content,'<embed src=’,'<div><embed src=’);
UPDATE pre_portal_article_content SET content=REPLACE(content,’height=”500″>’,’height=”500″></div><div>我爱自学https://www.5izixue.com/</div>’);

UPDATE pre_portal_article_content SET content=REPLACE(content,'<div><embed tt’,'<div><embed’);
UPDATE pre_portal_article_content SET content=REPLACE(content,’height=”tt500″>’,’height=”500″>’);

提醒:在进行SQL批量操作前,不要忘记进行网站数据库备份。

点赞(0) 打赏

评论列表 共有 0 条评论

暂无评论

微信小程序

微信扫一扫体验

立即
投稿

微信公众账号

微信扫一扫加关注

发表
评论
返回
顶部