WordPress评论链接函数comments_popup_link()会在链接处生产
文章链接#comments
这样的链接,#comments是指向文章_ S = O )页面评论模块的意思,但是搜索引擎会抓取到 文章链接 与 文章链接#comments 视为同一篇文章多个链接,对 SEO/ L % j C n ? Q 3 不是很友好。
给 WordPress 评论链接加上 nofollow 的方法就是在WordPress主题functio( I 0ns.php 文件中加入:
function add_nofollow_to_comments_popup_link(| f ; & q Q){
return ‘i G d 9 P L rel=”nofollow” ‘;
}
add_filter(3 & f h‘comments_popup_k W B j G Tlink_attributes’, ‘add_nofollow_to_comments_popup_link’);

