How to Add "nofollow" to WordPress Friendly Links

Publish: 2015-04-01 | Modify: 2017-06-21

nofollow is an attribute value of an HTML tag. The purpose of this tag is to tell search engines "do not follow the links on this web page or do not follow this specific link". Therefore, using the nofollow tag correctly can prevent the loss of website authority. Why does this article introduce adding nofollow to reciprocal links? Doesn't it seem unethical? Actually, it's not. Sometimes websites change their domain names or the other party's website is penalized. In these cases, temporarily adding nofollow after notifying the other party can be beneficial for everyone involved. However, remember to remove it in a timely manner.

If your WordPress site directly uses the "a" tag to add reciprocal links, adding nofollow is straightforward. Just add the "rel="nofollow"" tag within the "a" tag. However, if you are using the built-in reciprocal link function of WordPress, you need to make a small modification to complete the process. Let's discuss the specific method.

In the latest version of WordPress, the reciprocal link option has been removed by default. However, we can use the "Restore Reciprocal Links" plugin to bring back this option. But what if you don't find the option to add nofollow when setting up the reciprocal link?

The method is simple. Find the "meta-boxes.php" PHP file in "/wp-admin/includes/". After about line 964, add the following code. Save and overwrite the source file. Finally, you will see an additional nofollow option button. Update the link to complete the process.

<label for="nofollow">
<input class="valinp" type="radio" name="friendship" value="nofollow" id="nofollow" <?php xfn_check('friendship', 'nofollow'); ?> />&nbsp;<?php /* translators: xfn: http://gmpg.org/xfn/ */ _e('nofollow') ?>
</label>

Lastly, how can you determine if nofollow has been successfully added? If you are familiar with HTML tags, you can directly view the page source code and you will see that the specified link has an additional "rel="nofollow"" tag, indicating that it has been added successfully. What if I don't understand HTML? That's also simple. You can use a browser extension to help you identify it.

If you find this article helpful, please share it. If you have any questions, you can add me on QQ or leave a comment below. Well, I typed all this manually. I'll take a break for a while.


Comments