在wordpress网站中,当别人留言或者评论时就会在留言人的签名上加上一个连接,这对于自己网站SEO来说不是太好。
当然可以去掉wordpress这个功能,把wordpress评论中的签名连接去掉。屏蔽掉所有的评论留言中的签名连接。
打开wordpress的根目录wp-includes/comment-template.php
的这个文件,找到下面的代码(大概在152行):
if ( empty( $url ) || 'http://' == $url ) $return = $author; else $return = "<a href='$url' rel='external nofollow' class='url'>$author</a>"; return apply_filters('get_comment_author_link', $return);
将 <a href=’$url’ rel=’external nofollow’ class=’url’>$author</a>
这一句改成$author就可以了,改成这样:
if ( empty( $url ) || 'http://' == $url ) $return = $author; else $return = $author; return apply_filters('get_comment_author_link', $return);
然后保存,评论的签名链接就都打不开了。
注: 这个只对wordpress默认的的评论框有效,对第三方(多说,畅言等的)评论框没有效果。
未经允许不得转载:欲思博客 » wordpress屏蔽评论留言中的的签名连接
评论2