今天查詢站點的友鏈情況的時候發現“我的推薦”欄目下的鏈接并沒有加上nofollow屬性,該欄目主要存放的是一些有價值的博客,屬于tiandi發起的單向友鏈,所以可以加上nofollow屬性以免蜘蛛爬行出去。
我們來看下默認的鏈接關系是沒有辦法直接輸入內容的,只能通過下面的選項來選擇,但是所有的選項都沒有nofollow屬性,所以我們需要小小的修改一下,使得這里可以選擇nofollow項目.
修改方法也很簡單,xfn是在/wp-admin/meta-box.php里定義的,打開該文件,在836行左右找到類似以下代碼:
- <tr>
- <th scope="row"><?php /* translators: xfn: http://gmpg.org/xfn/ */ _e('identity') ?></th>
- <td><fieldset><legend class="screen-reader-text"><span><?php /* translators: xfn: http://gmpg.org/xfn/ */ _e('identity') ?></span></legend>
- <label for="me">
- <input type="checkbox" name="identity" value="me" id="me" <?php xfn_check('identity', 'me'); ?> />
- <?php _e('another web address of mine') ?></label>
- </fieldset></td>
- </tr>
在下面添加以下代碼即可:
- <tr>
- <th scope="row">Nofollow</th>
- <td><fieldset><legend class="screen-reader-text"><span>nofollow</span></legend>
- <label for="nofollow">
- <input class="valinp" type="checkbox" name="nofollow" value="nofollow" id="nofollow" <?php xfn_check('nofollow', 'nofollow'); ?> />
- nofollow</label>
- </fieldset></td>
- </tr>
新聞熱點
疑難解答
圖片精選