请问PBOOTCMS百度编辑器UEDITOR给超链接默认添加REL=”NOFOLLOW”标签
为了让UEditor在生成超链接时默认添加 rel="nofollow"
属性,可以按照以下步骤进行修改。这样可以防止搜索引擎蜘蛛流失,保护网站的权重。
修改步骤
-
修改
link.html
文件- 找到
core/extend/ueditor/dialogs/link/link.html
文件。 - 修改第 81 行。
将以下代码:
javascript'href' : href, 'target' : $G("target").checked ? "_blank" : '_self', 'title' : $G("title").value.replace(/^\s+|\s+$/g, ''), '_href':href
修改为:
javascript'href' : href, 'target' : $G("target").checked ? "_blank" : '_self', 'title' : $G("title").value.replace(/^\s+|\s+$/g, ''), 'rel': 'nofollow', '_href':href
- 找到
-
修改
ueditor.config.js
文件- 找到
core/extend/ueditor/ueditor.config.js
文件。 - 修改第 370 行。
将以下代码:
javascripta: ['target', 'href', 'title', 'class', 'style','name','id'], abbr: ['title', 'class', 'style'], address: ['class', 'style'], area: ['shape', 'coords', 'href', 'alt'],
修改为:
javascripta: ['target', 'href', 'title', 'class', 'style','name','rel','id'], abbr: ['title', 'class', 'style'], address: ['class', 'style'], area: ['shape', 'coords', 'href', 'alt'],
- 找到
更新时间:2025-04-11 00:01:40
上一篇:请问PbootCMS缩略图上传图片变模糊为什么?(1)
转载请注明原文链接:https://www.muzicopy.com/suibi/4413.html