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'],
- 找到
扫码添加技术【解决问题】
专注企业网站建设、网站安全16年。
承接:企业网站建设、网站修改、网站改版、BUG修复、问题处理、二次开发、PSD转HTML、网站被黑、网站漏洞修复等。
专业解决各种疑难杂症,您有任何网站问题都可联系我们技术人员。
本文来自博客园,作者:黄文Rex,转载请注明原文链接:https://www.cnblogs.com/hwrex/p/18443428