emlog程序给评论链接添加nofollow标签

emlog的评论默认没有nofollow标签,如果你网站一定要开评论功能,就会有做外链的人分走你网站权重。

nofollow标签主要作用是告诉搜索引擎"不要追踪此网页上的链接"。

今天洪雨分享,emlog程序给评论链接添加nofollow标签的方法

打开content/template/default模板文件夹,找到module.php文件,如果你使用了其他模板,可在相应的模板文件夹找到。

 

找到代码:

$comment['poster'] = $comment['url'] ? '<a href="'.$comment['url'].'" target="_blank">'.$comment['poster'].'</a>' : $comment['poster'];
修改为:
$comment['poster'] = $comment['url'] ? '<a href="'.$comment['url'].'" target="_blank" rel="nofollow">'.$comment['poster'].'</a>' : $comment['poster'];

 

保存文件后,再进后台更新一下缓存,就可以看到效果了。

原文转载自:http://www.zhizhuowz.com/post-653.html

posted @ 2021-08-01 10:21  洪雨  阅读(83)  评论(0编辑  收藏  举报

友情链接

洪雨营销