当前位置:首页>站长学院>PbootCms教程

pbootcms百度编辑器ueditor给超链接默认添加rel="nofollow"标签

来源:本站 发布时间:2021-12-23热度:475 ℃

随着越来越多的站长开始重视seo了,对rel="nofollow"也在乎得多了。但是由于百度编辑器ueditor并不自带rel="nofollow"功能,在引入其他站点URL链接的时候,就会导致蜘蛛流失,自己的网站权重下降。

今天ABC模板网整理了一下,来教大家怎么改,让ueditor的link自带rel="nofollow"标签,话不多说,直接上图。


1、找到/core/extend/ueditor/dialogs/link/link.html,修改第81行。

image.png

'href' : href,
'target' : $G("target").checked ? "_blank" : '_self',
'title' : $G("title").value.replace(/^\s+|\s+$/g, ''),
'_href':href

修改为

'href' : href,
'target' : $G("target").checked ? "_blank" : '_self',
'title' : $G("title").value.replace(/^\s+|\s+$/g, ''),
'rel': 'nofollow',
'_href':href


2、找到/core/extend/ueditor/ueditor.config.js,修改第370行。

image.png

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

修改为

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


上述两个文件修改好就可以实现rel="nofollow"了,网站后台测试添加链接,测试成功,演示图如下。

image.png

转载请注明来源网址:https://www.abcmuban.com/pbootcmsjc/167.html

如果你的问题还没有解决,点击PBootCMS建站交流群加入交流群一起学习交流。支持与鼓励站长,请扫码赞赏

  • 微信支付

    微信扫一扫

  • 支付宝支付

    支付宝扫一扫

推荐模板
交流学习

加入VIP即可下载全部模板;2天更新1套模板

年VIP:199元(金牌)

终身VIP:299元(钻石)

  • QQ号

    Q:2935517386

  • 添加微信客服

    微信客服

  • QQ号

    Q群:817597747

热门标签
 
Q:2935517386