This might be old news to you, but you should know that the Googlebot now follow links created by Javascript. I have seen evidence of this myself and was starting to get frustrated that I would have to reevaluate my site and patch any leaking link juice from Javascript links. Before I got to the point of full frustration, I realized that I can use this Googlebot “feature” to my advantage and use Javascript itself to easily correct this leaking link juice problem.
Finding Dofollow Links
Before correcting them, we have to find them! I use the awesome SearchStatus Firefox add-on to hunt down any unintentional dofollow links. After installing the plugin, I just enable the “Highlight Nofollow Links” feature by right clicking on the @ symbol on the bottom right of Firefox.

After enabling the “Highlight Nofollow Links” feature, you will see that all nofollow links will be highlighted red.

Nofollow Using jQuery Magic
The beautiful thing about jQuery is its ability to perform operations on multiple things with a single line of code. I can abuse this feature to help me set all links in any HTML block with a rel=”nofollow”. Just to give you an idea of how easy and powerful this is, this is the line I use to nofollow all links in my Intense Debate comment form:
$(".comment_form a").attr("rel", "nofollow"); |
To dofollow a certain set of links, you can do something like the following:
$(".blogroll a").attr("rel", ""); |
Easy isn’t it? No plugin hacking, no search and replace, and no hassle!
(For those of you who are not the jQuery type, you can take a look at the jQuery selector documentation to figure out the meaning of “.comment_form a”.)
Integration
In this section, I will show you how to get jQuery code to run on every page load.
- Download nofollow.js and place it anywhere on your server as a base to start from.
- Modify nofollow.js using jQuery to follow/nofollow any links as you see fit.
- Refer to nofollow.js in the footer of your template. For example:
<script type="text/javascript" src="/path/to/your/nofollow.js"></script>
Final Thoughts
After realizing the power of jQuery and this Googlebot feature, patching leaking PR link juice isn’t that bad after all.
Do you guys have a better method of doing this? Do you disagree with my Googlebot findings? Do you know any other search engines that follow Javascript links? Please let me know in the comments section.
commented on March 3rd, 2009 at 6:42 pm
Why would you use JavaScript to add NoFollows? Search engines don't execute JS, and will just read them as DoFollows…
commented on March 3rd, 2009 at 6:46 pm
Googlebot does execute Javascript and follow links generated by Javascript and I also I think there is a strong trend in other search engines moving towards JS execution to resolve links.
commented on March 3rd, 2009 at 6:48 pm
Let's see some links proving or disproving the above, please.
commented on March 3rd, 2009 at 7:01 pm
Also… if I only have dofollow links generated by Javascript. I think it's safe to just disable those via Javascript itself
.
commented on March 5th, 2009 at 4:19 am
You mentioned "leaking juice" via dofollow links. My understanding was that page rank is determined by incoming links and outgoing links don't affect the page's rank they come from only how much "juice" each link gets.
commented on March 5th, 2009 at 9:27 pm
@Pet Snakes
The whole topic is certainly highly debated. Regardless, nofollow plays an important role in controlling which result page gets the most juice. If I link to somebody externally, I would want to do them the favor of passing a really juicy link rather than a less juicy one (caused by a bunch of my other dofollow internal links to useless page).
Here is some more info from seomoz (http://www.seomoz.org/blog/whiteboard-friday-the-…
commented on March 5th, 2009 at 11:00 pm
Thanks. I'll have a look at the link.
commented on March 6th, 2009 at 7:13 pm
Really? When did they add that feature…?
commented on March 6th, 2009 at 7:21 pm
@redwall_hp
I think it's been a while (See first link of this article). I started noticing when my Google Webmaster Central reported "Not Founds" from my ever-changing Javascript BSA ad URLs.
commented on March 6th, 2009 at 8:25 pm
Well… *That* certainly is interesting.
commented on May 18th, 2009 at 8:46 am
It's rather interesting, does jQuery Magic tool allows adding do-follow links manually?
Now I share the opinion that javascript-generated links are checked by Google. That's why no fear that javascript based menu can harm your sites positions in search engines.
commented on July 7th, 2009 at 10:53 am
If this works it will save me heaps of time. This is very helpful for working with websites that work with content dynamically generated.
commented on July 7th, 2009 at 11:50 am
Just to confirm… this will change all targeted links into nofollow links AND google will treat them properly as nofollow links? Does this only apply to links within javascript or can it be used for all links?
commented on July 8th, 2009 at 6:08 pm
That is correct, google will treat them properly as nofollow links. It can be used with all links.
commented on July 11th, 2009 at 1:50 pm
I also use NoDoFollow Firefox add-on. It works wonders for me.
commented on August 19th, 2009 at 7:15 am
Your article clearly describe the advantage of do follow links.
commented on July 31st, 2010 at 11:09 am
Why would you use JavaScript to add NoFollows? Search engines don't execute JS, and will just read them as DoFollows…
+ 1000
commented on August 2nd, 2010 at 5:47 pm
Dude… read the first sentence of the article.
commented on August 2nd, 2010 at 6:04 pm
Google follow javascript link but nobody said it takes care about nofollow add by javascript.
++
commented on August 2nd, 2010 at 7:45 pm
Why wouldn't they? It seems pretty easy to do and that is their business. I'd imagine their crawler to do something like:
1. Fetch page
2. Evaluate JavaScript
3. Analyze HTML for content, links w/ nofollow, etc.
4. ???
5. ???
6. Profit!
If they dofollow all JavaScript links even if there is a nofollow tag on those links, then we are in trouble if we use 3rd party comment platforms like Disqus & Intense Debate (have dofollow links in the comment thread). You would be leaking all kinds of link juice if Google didn't abide to nofollow in JavaScript.
Given how easy it is to do it, it wouldn't hurt to nofollow all those links by JavaScript.
commented on August 2nd, 2010 at 10:38 pm
If you want to be sure and not make mistake put all html link in nofollow and add java to tranform these link in dofollow.
But PR sculpting is dead since google take nofollow link to remove juice.
http://www.seomoz.org/blog/google-maybe-changes-h…
commented on September 4th, 2010 at 11:27 pm
Great script. I need that so much.
I looked over a week for something like this.
Thank you!
commented on February 14th, 2011 at 10:05 pm
I've updated the script so that it will correctly highlight links which have the string "nofollow" anywhere in the rel attribute.
Edit: Just to add, you'll need to visit the page linked above and add it to your favourites again to get the updated version.
commented on April 13th, 2011 at 2:19 pm
I have installed this and it does not seem to work. I should be able to see the “rel=”nofollow” appearing on the links of the intense debate commenter’s profiles, right?
eartheasy.com/blog