Can Google follow and index Javascript links


Are you wondering whether Google can detect links in Javascript? Read this article to learn how Google can parse Javascript and follow the links from it.

We had the following link from the footer of all pages of all sites in our network.

<a href="javascript: window.open('http://www.indiastudychannel.com/general/PartnerSites.aspx')">Revenue Sharing sites</a>

The reason we used Javascript to open the link was to hide link from the eyes of Google and avoid any potential link spam penalty. However, it appears that Google is much smarter than we thought.

I looked at the "Links to your site" section in the Google Webmaster Tools and was shocked to see what was waiting for me there. Google reported about 1.7 million links to my site, out of which more than 50% were the links to the specific url used in the Javascript. Even though the url used in the Javascript was not really "links" in true HTML terms and SEO language, Google still parsed the Javascript and learnt that we are opening that page when user click on the link and hence Google counted them all as Links.

Links to Your Site - Javascript Links and SEO
The Javascript links from our site network was counted by Google as links

There were about 880K links reported by Google to the same page, which were from all the other sites in our network that used Javascript instead of regular html hyperlinks.

Javascript links pass link juice

I am not sure if the target site was penalised for having so many links. There was no manual penalty reported by Google and there is no way to know if there was an automatic, algorithmic penalty applied. Our site has recently lost a lot of traffic and hence I am assuming some sort of penalty is in effect. I figured this link issue while trying to figure out what kind of penalty may have applied on our site.

What does Google's Matt Cutts say about links from Javascript


Watch this video by Matt Cutts and see his views on Google parsing the Javascript in webpages.



According to Matt Cutts, Google will try to parse and understand Javascript in the webpages and he does not recommend we doing anything to block Google from it since it is better to allow Google to understand what is in the page.

What is the solution?

The mistake I did was, I assumed Google wouldn't parse the Javascript and wouldn't consider the links in the script. If you want to use links from Javascript, you may move it to a .js file and stop Google from indexing the file, which Google does not recommend.

An alternative solution is to use rel="nofollow" attribute, even if you are using Javascript to open the url.

How to use rel="nofollow" attribute when you use Javascript to open urls



You can use the rel="nofollow" attribute, even if you are using Javascript to open hyperlinks. Here is an example using my own case above.

<a href="javascript: window.open('http://www.indiastudychannel.com/general/PartnerSites.aspx')" rel="nofollow">Revenue Sharing sites</a>


So, contrary to the common belief that Javascript links are ignored by Google, this experience shows that Google can understand Javascript and also follow the links from there.

Read Why Ajax is the Cooler Cousin of JavaScript?


Article by Tony John
Tony John is a professional blogger from India, who started his first Weblog in 1998 at Tripod.com. Tony switched to blogging as a passion blended business in the year 2000 and currently operates several popular web properties including IndiaStudyChannel.com, Techulator.com, dotnetspider.com and many more.

Follow Tony John or read 636 articles authored by Tony John

Related Articles

Some SEO Tips I learnt from Matt Cutts

Are you looking for SEO tips from Matt Cutts, the SEO guru for most of the webmasters and bloggers? Matt Cutts is an engineer at Google and works with the Webspam team in Google Search. Find out some great SEO tips, which are my interpretation of original advises from Matt Cutts.

How to make my blog rank first in Google

When someone search in Google, how to make my website come up first in Google is one of the most common question asked by new bloggers. If you are looking for the secret behind making your blog come up first in Google search, read this article.

How does guest posting affect SEO

Do you use Guest blogging as one of the ways to build links to your blog? This article explains how guest blogging can affect your sites ranking and SEO.

More articles: SEO Tips Search Engine Optimization Google Search JavaScripts

Comments

Guest Author: michael31 Aug 2014

Just wanted to thank you for this article. I saw a Matt Cutts video listing ways to stop google indexing Javascript links but it did not explain clearly if rel = nofollow should be added to the normal html a tag or if it should go elsewhere.

Have you tested that adding rel=nofollow to the A tag works?

Guest Author: Michael19 Dec 2014

As the other comment from Michael asks, how do you know that Google honours the rel nofollow on a javascript link?

I have heard others doubting this, so it may be slightly misleading to tell everyone just to add rel= no follow without any evidence?

If you do have evidence of this, that would be fantastic news as I am struggling to find any.



  • Do not include your name, "with regards" etc in the comment. Write detailed comment, relevant to the topic.
  • No HTML formatting and links to other web sites are allowed.
  • This is a strictly moderated site. Absolutely no spam allowed.
  • Name:
    Email: