BITCOIN, LITECOIN

One of the things I wished I’d known earlier in time of starting to blog is adding ‘nofollow’ tag to external links. Nofollow tag is just an HTML attribute that instruct search engine spider not to crawl or follow a link and it is very easy to implement.

How does it function and why do you really need to care about it on your blog or website? To get answers to these questions, read our post on: What is nofollow attribution.

I wasn’t privilege enough to come across a post on it on time neither do I have a mentor to guide me through the art of blogging until now that Frandimore gave me the platform to explore the world of blogging.

Why do I somewhat regret a bit on this? It’s because of how simple yet important it is to add ‘nofollow’ tag to links discreetly on the basis of SEO. Lets quickly take a look at this to see if it really worth the while.

Importance of nofollow on links

-It helps preserve the primary purpose and intent of linking to external content within a post.

– It let you determine which link or site to pass vote of authority.

– It doesn’t dilute link equity on chances to rank high on SERP for a keyword.

– It keep your site save from Google penguin trouble on link trade penalty.

– Affiliate links are also safe to use with nofollow tag.

The main purpose of this tag therefore is that it enhances the SEO of your website. No matter how important it is to your website rank on SERP, you have to understand how to implement it on your site.

To make the matter worse, WordPress post editor (the place you compose your blog post) does not have any function or tab whereby nofollow could be added to links created. Any link formed within the post editor is a direct ‘dofollow’ whether internal or external.

At best, a nofollow would have to be added manually to hyperlinks within WordPress post editor. Exception is the comment area of WordPress blog that have been set to automatic ‘nofollow’ by default since 18, January 2008 when Google and other notable search engine providers tried to put a stop to spam links that come from blog comments.

It is expedient to have ways by which we could add nofollow to links at will without stress. That is the aim of this post. I would reveal three distinct ways by which you can add nofollow attribution to your links with ease.

3 Ways of adding nofollow tag to links

Nofollow can be added through plugin, code or inserted manually. For easy access, you may click on any of the three options below that best suit your need.

Insert manually
Insert through plugin
Insert through code method

Let’s start from the simplest

1. Insert manually

To insert nofollow tag manually, you have to first create the hyperlink either in text or image format on WordPress post editor.

Open the html editor since nofollow is an html (rel=”nofollow”).
For text; the link would be like the one below:

 <a href="http://frandimore.com/">frandimore</a> 

To add nofollow tag to the above link, you’ll have to insert it like this:

 <a href="http://frandimore.com/" >rel="nofollow">frandimore</a> 

Where the rel=”nofollow” is the nofollow tag.

The above link example will open in the same tab when clicked in the front-end.

To add nofollow to text link that opens in a new window or tab, follow the example below.

The link without nofollow tag:

 <a href="http://frandimore.com/" target="_blank">frandimore</a> 

If we add nofollow, it becomes like this:

 <a href="http://frandimore.com/"target="_blank" rel="nofollow"</span>>frandimore</a> 

For images: you would have to insert the image into post editor. Create the link and then open the html editor and locate the image html.

It should look like this:

 <a href="http://frandimore.com/"><img class="aligncenter size-full wp-image-5627" src="http://frandimore.com/wp-content/uploads/2015/02/Tineye.png" alt="Tineye" width="635" height="212" data-id="5627" /></a> 

When you insert nofollow tag, it becomes like this.

 <a href="http://frandimore.com/" rel="nofollow"><img class="aligncenter wp-image-5627 size-full" src="http://frandimore.com/wp-content/uploads/2015/02/Tineye.png" alt="Tineye" width="635" height="212" data-id="5627" /></a> 

NOTE: It is possible to insert nofollow tag to images on WordPress without having to do it manually. To do this, click on the image within post editor. On the top you’ll see a pencil icon. Click on it. On the new page that emerge, scroll down and click on ‘Advance Options’.

On the ‘Link Rel’ box, type nofollow. Click on ‘Update’. You may read our blog post on how to insert image on WordPress for in-depth insight.

2. Insert through plugin

There is a plugin called ‘Rel Nofollow Checkbox‘ that add nofollow checkbox functionality just below the box where you create links on WordPress post editor.

This makes it handy and much convenient to add rel nofollow to links automatically as they are created.

To install this plugin on your site, go straight to WordPress plugin repository and search for rel nofollow checkbox or you may do the search within your admin dashboard by going to Plugins >> Add New.

Install and activate the plugin. The plugin will add the checkbox function automatically below hyper link creation section of the post editor.nofollow checkbox plugin

So, you don’t have to look for the plugin setting page because it doesn’t require that to function.

If you ask me, this function should have been provided by WordPress on default instead of having to access it through plugin. I wish and hope WordPress would incorporate it into their feature update sometime soon.

How to add nofollow to existing external links

Now, suppose you have created so many external links in the past you wished you’d added nofollow. Sincerely speaking, this could be the state of most people reading this post.

I’ve just talked from experience because that was the way I felt when I discovered I needed to ‘nofollow’ some links even though I linked to those sites to enhance salient points.

It would have been a ton of hectic work for me and blogs owner that have hundreds of posts with external links that crave for nofollow tag if a plugin called ‘External Link‘ weren’t available.

If you are in this position, go straight and install this plugin on your site. Activate it and head on to the setting page.

Configure it for what you want it to do. The plugin has other setting options like open link in new window, add icon to outbound links, etc.

Below is a screenshot that pertain to setting it to add rel=”nofollow” to external links.nofollow external linksOf course, it excludes internal links from this list because you surely want search engine spider crawl all your links and index them.

3. Insert through code

If you don’t want to install another plugin on your site for fear of slow page load or likely conflict with existing plugins that could break your site structure, then code method is the way to go.

It’s really simple to implement. It’s just about copy and paste, but care must be taken in terms of the exact placement.

This method will add nofollow tag to all external links created and then exclude specified links within the code.

Please, ensure you backup your site whenever you want to alter file configuration.

Copy the code below and paste it at the bottom of your theme function.php file.

/**
* add nofollow to links
*/
function add_nofollow_content($content) {
$content = preg_replace_callback(
'/<a[^>]*href=["|']([^"|']*)["|'][^>]*>([^<]*)</a>/i',
function($m) {
if (strpos($m[1], "YOUR_DOMAIN_HERE") === false)
return '<a href="'.$m[1].'" rel="nofollow" target="_blank">'.$m[2].'</a>';
else
return '<a href="'.$m[1].'" target="_blank">'.$m[2].'</a>';
},
$content);
return $content;
}
add_filter('the_content', 'add_nofollow_content');

Change ‘Your_Domain_Here’ to your site URL and click save.

To exclude certain links, copy the code below again and paste it below the above code in your theme function.php file after you have changed ‘example domain’ to the url of the sites you want to exclude.

/**
* add nofollow to links
*/
function add_nofollow_content($content) {
$content = preg_replace_callback(
'/<a[^>]*href=["|']([^"|']*)["|'][^>]*>([^<]*)</a>/i',
function($m) {
if (strpos($m[1], "EXAMPLE_DOMAIN") === false && strpos($m[1], "EXAMPLE_DOMAIN") === false)
return '<a href="'.$m[1].'" rel="nofollow" target="_blank">'.$m[2].'</a>';
else
return '<a href="'.$m[1].'" target="_blank">'.$m[2].'</a>';
},
$content);
return $content;
}
add_filter('the_content', 'add_nofollow_content');

Click update and you’re done. This code was instituted by Digitizor

Conclusion: You can see that it is really simple to implement this all important SEO inclined feature on your website. But remember that you do not have to add nofollow tag to all external links.

However, it is more of been discretional than a rule. Haven’t said that, it is a rule to not unfollow all your internal links except standalone or custom pages that are not really relevant to post content, but important for user or visitors e.g. privacy policy, term of service, etc. What do you think?

Image Credit: Wordstream

Francis 'Toke

Creative Web Developer at Frandimore
Level headed individual, writing blog post for Frandimore when not engrossed on projects.
Shares
Share This