WordPress的功能强大, 很多东西可以定制, 但在侧面的评论老是会显示站外链接, 对SEO很不力, 也会引来好多垃圾评论. 如何修改让让评论不显示作者链接?
我的方法是修改 /wp-include/default-widgets.php文件, 找到
$output .= ‘<li>’ . /* translators: comments widget: 1: comment author, 2: post link */ sprintf(_x(‘%1$s on %2$s’, ‘widgets’), get_comment_author_link(), ‘<a href=”‘ . esc_url( get_comment_link($comment->comment_ID) ) . ‘”>’ . get_the_title($comment->comment_post_ID) . ‘</a>’) . ‘</li>’;
改成
$output .= ‘<li>’ . /* translators: comments widget: 1: comment author, 2: post link */ sprintf(_x(‘%1$s on %2$s’, ‘widgets’), get_comment_author(), ‘<a href=”‘ . esc_url( get_comment_link($comment->comment_ID) ) . ‘”>’ . get_the_title($comment->comment_post_ID) . ‘</a>’) . ‘</li>’;
其实就是把get_comment_author_link() 中的_link去掉就可了. 这样只会显示作者名子页没有链接了.
如果去了,留言的人就会少了。
在于质量,不在于多少.
不去有不去的道理,如果去了网站的评论就少了