PBOOTCMS百度编辑器UEDITOR给超链接默认添加REL=”NOFOLLOW”标签

为了让UEditor在生成超链接时默认添加 rel="nofollow" 属性,可以按照以下步骤进行修改。这样可以防止搜索引擎蜘蛛流失,保护网站的权重。

修改步骤

  1. 修改 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
  2. 修改 ueditor.config.js 文件

    • 找到 core/extend/ueditor/ueditor.config.js 文件。
    • 修改第 370 行。

    将以下代码:

    javascript
     
    a: ['target', 'href', 'title', 'class', 'style','name','id'], abbr: ['title', 'class', 'style'], address: ['class', 'style'], area: ['shape', 'coords', 'href', 'alt'],

    修改为:

    javascript
     
    a: ['target', 'href', 'title', 'class', 'style','name','rel','id'], abbr: ['title', 'class', 'style'], address: ['class', 'style'], area: ['shape', 'coords', 'href', 'alt'],
posted @   黄文Rex  阅读(18)  评论(0编辑  收藏  举报
(评论功能已被禁用)
相关博文:
阅读排行:
· Manus重磅发布:全球首款通用AI代理技术深度解析与实战指南
· 被坑几百块钱后,我竟然真的恢复了删除的微信聊天记录!
· 没有Manus邀请码?试试免邀请码的MGX或者开源的OpenManus吧
· 园子的第一款AI主题卫衣上架——"HELLO! HOW CAN I ASSIST YOU TODAY
· 【自荐】一款简洁、开源的在线白板工具 Drawnix
点击右上角即可分享
微信分享提示