这种小技巧我相信大多数人都已经知道了。应该保持该链接在页面中的唯一性,告诉爬虫、蜘蛛哪些链接是重要的,哪些链接可以不用理。
具体的我也不详讲了。贴出来收藏一下。
为 WordPress 的 Read more 加上 nofollow
可以将以下代码加到 function.php 中实现在 read more 链接上添加 nofollow。
function add_nofollow_to_link($link) { return str_replace('<a', '<a rel="nofollow"', $link); } add_filter('the_content_more_link','add_nofollow_to_link', 0);
为 WordPress 的评论链接加上 nofollow
可以在 function.php 中加入以下代码来为 WordPress 的评论链接加上 nofollow
function add_nofollow_to_comments_popup_link(){ return ' rel="nofollow" '; } add_filter('comments_popup_link_attributes', 'add_nofollow_to_comments_popup_link');
相关文章: