Add the nofollow attribute to the XFN link of Wordpress

Source: Internet
Author: User

Today, I found that the link in the "My recommendations" column does not contain the nofollow attribute. This column mainly stores valuable blogs, it is a one-way friend chain initiated by tiandi. Therefore, the nofollow attribute can be added to prevent crawlers from crawling out.

We can see that there is no way to directly enter the content in the default link relationship. We can only select the link through the options below, but none of the options have the nofollow attribute. So we need to modify it a little bit, so that the nofollow project can be selected here.

The modification method is also simple, xfn is defined in/wp-admin/meta-box.php. Open the file and find the code similar to the following in line 3:

The code is as follows: Copy code
<Th scope = "row"> <? Php/* translators: xfn: */_ e ('Identity ')?> </Th>
<Td> <fieldset> <legend class = "screen-reader-text"> <span> <? Php/* translators: 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>

Add the following code below.

The code is as follows: Copy code

<Th scope = "row"> Nofollow </th>
<Td> <fieldset> <legend class = "screen-reader-text"> <span> nofollow </span> </legend>
<Label for = "nofollow">
<Input class = "valindium" type = "checkbox" name = "nofollow" value = "nofollow" id = "nofollow" <? Php xfn_check ('nofollow', 'nofollow');?> />
Nofollow </label>
</Fieldset> </td>

Okay. Let's see if the result is as shown in the following figure.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.