欧美bbbwbbbw肥妇,免费乱码人妻系列日韩,一级黄片

去除wordpress中評(píng)論中的nofollow的方法

  發(fā)布時(shí)間:2012-10-29 10:21:04   作者:佚名   我要評(píng)論
我們經(jīng)常會(huì)遇到nofollow屬性,特別是wordpress的評(píng)論會(huì)自動(dòng)添加上external nofollow屬性。那么什么是nofollow呢?在我們不想要的時(shí)候怎么能去掉呢?
  我們先來(lái)看一下什么是nofollow。NoFollow是Google幾年前提出的一個(gè)新標(biāo)簽,目的是減少垃圾留言。此標(biāo)簽表明鏈接與網(wǎng)站作者無(wú)關(guān),也就是說(shuō)搜索引擎不會(huì)用這個(gè)鏈接計(jì)算網(wǎng)站的 PR值。很多博客程序都會(huì)自動(dòng)在評(píng)論鏈接中加上nofollow標(biāo)簽。現(xiàn)在主流的Blog程序,如WordPress和MovableType、z-blog等等,均默在其留言的鏈接中自動(dòng)添加nofollow屬性。在wordpress中加的是rel=” external nofollow”.例:Mitzie Farrer這段代碼是沉緣seo在自己的小站源代碼中找到的external nofollow 屬性。
  那么nofollow與external nofollow有區(qū)別嗎?在沒(méi)明白二者的區(qū)別前我們先來(lái)了解一下二者的意思,rel=’external nofollow’與rel=’nofollow’其功能就中文譯文”不要讀取” 及”外部鏈接不要讀取”的意思!由此可見(jiàn)二者的作用是相同的,只不過(guò)external nofollow是比nofollow更專(zhuān)業(yè)的寫(xiě)法,即明確指出鏈接為外部鏈接,蜘蛛可以略過(guò)。
  當(dāng)我們不想讓評(píng)論中的鏈接帶有nofollow或者external nofollow屬性時(shí),該怎么去掉呢?
  那么請(qǐng)打開(kāi)我們的wordpress,然后找到wp-include文件夾,打開(kāi)comment-template.php頁(yè)面,找到如下代碼:

復(fù)制代碼
代碼如下:
  
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’。這樣我們的評(píng)論中就不會(huì)再出現(xiàn)external follow了。

相關(guān)文章

最新評(píng)論