### 修改步骤 #### 第一步:编辑link.html文件 找到/core/extend/ueditor/dialogs/link/link.html文件,并定位到第81行。原始代码如下:
'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
#### 第二步:编辑ueditor.config.js文件 接下来,找到/core/extend/ueditor/ueditor.config.js文件,并定位到第370行。原始代码如下:
a: ['target', 'href', 'title', 'class', 'style','name','id'],
abbr: ['title', 'class', 'style'],
abbr: ['title', 'class', 'style'],
area: ['shape', 'coords', 'href', 'alt'],
a: ['target', 'href', 'title', 'class', 'style','name','rel','id'],
abbr: ['title', 'class', 'style'],
abbr: ['title', 'class', 'style'],
area: ['shape', 'coords', 'href', 'alt'],
### 测试与效果 完成上述两个文件的修改后,您可以进入网站后台测试添加链接的功能。如果一切正常,生成的链接将会自动带有rel="nofollow"属性。以下是演示效果截图:
通过以上操作,您的UEditor编辑器将能够更好地支持SEO优化,有效避免因外部链接导致的权重流失问题。希望这篇文章能帮助到正在为此困扰的站长们!