Thứ Ba, 7 tháng 1, 2014

Tự Động Đặt Nofollow Cho Liên Kết Ngoài

tự chèn nofollow
Nofollow là một yếu tố rất quan trọng trong SEO mà bất kỳ một SEOER nào cũng phải biết.
Để tự động đặt nofolow cho liên kết ngoài bạn có thể thực hiện:

B1: Bạn vào Mẫu -> Chỉnh sửa HTML ->Chọn Mở rộng Mẫu Tiện ích

B2 : Thêm đoạn code vào trước thẻ </body>



<script src='http://ajax.googleapis.com/ajax/libs/jquery/1.3.2/jquery.min.js' type='text/javascript'/>


<script type='text/javascript'>


//<![CDATA[


jQuery('a').each(function() {


var href = jQuery(this).attr('href');


if (typeof href != 'undefined' && href != "" && (href.indexOf('http://') != -1 ||


href.indexOf('https://') != -1) && href.indexOf([removed].hostname) == -1) {


jQuery(this).attr("rel", "nofollow");


}


});


//]]>


</script>


Hoặc thêm đoạn code vào trước thẻ </body>

<!-- Start// Xóa nó nếu như trong blog của bạn đã chứ bất kỳ tập tin jQuery.js nào trước đó-->
<script src='http://ajax.googleapis.com/ajax/libs/jquery/1.7.2/jquery.js' type='text/javascript'></script>
<!--End-->
<script type="text/javascript">
jQuery(document).ready(function () {
jQuery('a[href*="http://"]:not([href*="http://mmoforfun.blogspot.com"])').attr('rel', 'nofollow');
jQuery('a[href*="https://"]:not([href*="http://mmoforfun.blogspot.com"])').attr("target", "_blank");
});
</script>

Không có nhận xét nào:

Đăng nhận xét