最近一直有人留言或评论说我的友链中有加nofollow属性,可是一直找不到设置项,很是烦恼,甚至都要放弃目前的主题,可是目前的主题我搜过没有此属性呀,后来再次问度娘,终于找到方法,和主题没关系,是wordpress的文件。
那么请打开我们的wordpress,然后找到wp-include文件夹,打开comment-template.php页面,找到如下代码:
function get_comment_author_link( $comment_ID = 0 ) {
/** @todo Only call these functions when they are needed. Include in if… else blocks */
$url = get_comment_author_url( $comment_ID ); $author = get_comment_author( $comment_ID ); if ( empty( $url ) || „http://‟ == $url ) $return = $author; else
$return = “$author”;
return apply_filters(„get_comment_author_link‟, $return);
}
在这些代码,去掉rel=‟external nofollow‟或者把这行代码换做target=‟_blank‟。这样我们的评论中就不会再出现external follow了。 如果其他也不要了,就修改此文档中的属性即可。
2015年12月29日 13:26 4F
如果在文章中 出现不想被抓取的网址 可以使用nofollow标签
2015年12月26日 12:56 3F
WordPress,没用过
2015年12月21日 23:29 2F
学习了,多谢分享
2015年12月22日 08:26 B1
@ 网赚博客 @网赚博客 谢谢访问。
2015年12月21日 17:25 1F
这个默认是没有的,可能你修改过WordPress文件吧
2015年12月21日 17:31 B1
@ boke112导航 @boke112导航 我没有修改过呀,可奇怪了,今天才百度到这个文件,修改了就好了。