最新消息:

WordPress 友情链接添加 Nofollow

跟隔壁小伙伴串门多了,不免会相互交换友链。随着岁月的流逝,有的小伙伴就会坚持不下去或者热情过了,网站就会放弃做下去。但是毕竟友情还在那,估摸着兴许哪天他会回来继续呢,所以不会狠心下掉友链。但是死链太多有可能影响 SEO(我猜的)。所以先加上 nofollow 吧,回来了再去掉。其实方法有很多种,百度一大把,我在这主要就推荐一个。

/*
 功能描述: 在 XFN 中增加 follow 关系
 功能介绍页面: https://www.ivicos.com/47.html
*/
function admin_xfn() {?>
 <script type="text/javascript">
 addLoadEvent(addNofollowTag);
 function addNofollowTag() {
 tables = document.getElementsByTagName('table');
 for(i=0;i<tables.length;i++) {
 if(tables[i].getAttribute("class") == "links-table") {
 tr = tables[i].insertRow(1);
 th = document.createElement('th');
 th.setAttribute('scope','row');
 th.appendChild(document.createTextNode('Follow'));
 td = document.createElement('td');
 tr.appendChild(th);
 label = document.createElement('label');
 input = document.createElement('input');
 input.setAttribute('type','checkbox');
 input.setAttribute('id','nofollow');
 input.setAttribute('value','nofollow');
 label.appendChild(input);
 label.appendChild(document.createTextNode(' nofollow'));
 td.appendChild(label);
 tr.appendChild(td);
 input.name = 'nofollow';
 input.className = 'valinp';
 if (document.getElementById('link_rel').value.indexOf('nofollow') != -1) {
 input.setAttribute('checked','checked');
 }
 return;
 }
 }
 }
 </script>
<?php
}
add_action('admin_head','admin_xfn');

然后你再添加链接时,就会在“链接关系(XFN)”列表中看到 nofollow 选项了。这时候,你不仅可以给已添加的链接增加 nofollow ,也可以给新链接直接增加 nofollow。

好了,Wordpress 友情链接添加 Nofollow 这个方法就分享到这里,非常感谢你的来访。如果你很喜欢本站,请不要忘记收藏本站,以便下次继续访问;也可以 关注站长微博 随时获取最新动态。你的支持就是我最大的动力!

转载请注明:爱维科斯 » WordPress 友情链接添加 Nofollow

支付宝打赏支付宝打赏 微信打赏微信打赏

如果文章对你有帮助,欢迎点击上方按钮打赏作者