JavaScript backlinks are lingering question marks for SEOs.

We know that they're executed in JavaScript, rather than coded in HTML with the classic form of anchor text.

And we know Google tracks them.

Google told us this in 2014 and Search Engine Land reported on tests that confirmed it in 2015.

Onely ran an in-depth study in 2017 and confirmed that Google does crawl and execute JavaScript even for websites built on JavaScript frameworks like Angular, React and Vue instead of a traditional CMS like WordPress.

But until recently, SEOs and webmasters haven't had any insight into the JavaScript backlinks pointing to their sites.

It's been difficult to discover them in the first place.

Most of our favorite SEO and backlink tools aren't able to see them at all.

In fact, I'd venture to say that most SEOs and webmasters don't even know about the existence of JavaScript backlinks.

So, let's start with the basics.

Answers to the FAQ About JavaScript Backlinks

What are JavaScript Backlinks?

A backlink contained in JavaScript code is a JavaScript backlink. (Easy, right?)

But what exactly is JavaScript?

JavaScript (JS) is a web programming language. It runs and executes in the web browser.

Javascript Example

It's different than HTML, which is static. Think of HTML as the bones of a website, and JavaScript as the muscle.

While HTML determines the structure of a website, JavaScript lets the elements on a website change and move.

For an example, scroll down on this page. The lightbox that pops up? That's controlled by JavaScript.

How Do Backlinks End Up in JavaScript?

To answer this question, we first need to answer: What is a backlink?

A backlink is a hyperlink to another web page. In the SEO world, we call them "backlinks" because they link back to our sites. But make no mistake: a backlink is a hyperlink.

There are many ways backlinks end up in JavaScript code. Here are some of the most common examples:

  • Redirects
  • Drop-down menus
  • Dynamically inserted content

All of these are essential features of the web. Redirects commonly occur after someone submits a form and you send them to a thank you page—this is good functionality and that redirect constitutes a backlink to your thank you page.

When you click a drop-down menu, you're triggering JavaScript that creates new elements on the page (the items in the drop-down). If any other things items link to another page, guess what? That's a JavaScript backlink.

For an example of dynamically inserted content, scroll down this page until a lightbox appears.

That's dynamically inserted content—you trigger the JavaScript code that lives on this page by scrolling down, and the lightbox that appears has buttons that contain backlinks to other pages on this site.

How are JavaScript Backlinks Different Than "Normal" HTML Backlinks?

HTML Backlink Example

Because JavaScript runs in a web browser and Google originally didn't use a browser to crawl pages. Therefore, Google didn't execute JavaScript.

Thus, any part of the page that was rendered in JavaScript wouldn't be seen by Google.

And while Google has advanced and now executes JavaScript, most of the tools SEOs use to gain insight into backlinks don't.

Because our tools are blind, we SEOs and webmasters are also blind.

How Does Google Treat JavaScript Backlinks?

Like every other backlink. Here's Google's confirmation:

There's one little snag to be aware of, and it comes down to timing.

If you're dynamically adding the rel=“nofollow" snippet and this happens after Googlebot indexes your JavaScript, then it will index that link as a dofollow link.

This makes sense. Changing the page after Googlebot arrives and expecting Googlebot to pick up on those changes is silly.

That's All Great...But Why Should I Care About JavaScript Backlinks?

If you're reading the SEOptimer blog, you probably care about backlinks.

So, there's that.

I'd bet you're definitely aware that your backlink profile is one of Google's top 3 ranking factors.

Google Ranking Factors
Image Credit: Google

We've covered the reasons to keep a clean backlink profile before, but to recap:

  • Poor visibility of JavaScript backlinks impacts your ability to keep a clean backlink profile. If you can't see all the links pointing to your site, you don't know which links to disavow. Your ability to combat negative SEO is weaker.
  • Likewise, since Google can see JavaScript backlinks, it's likely using them in its evaluation of link-based penalties. If you can't see backlinks from JavaScript, you have no way of combating a penalty that's based on bad JavaScript backlinks.
  • Knowing who has linked to your site gives you a valuable opportunity to cultivate a relationship. Missing JavaScript backlinks means you miss that opportunity.
  • Google uses internal links to learn about your site's architecture. Understanding the JavaScript internal backlinks in your site gives you a better understanding of how Google perceives your site's architecture.

If you're ignoring JavaScript backlinks and you notice your rankings and traffic and revenue are dropping, perhaps it's because you're being attacked by JavaScript backlinks that most SEO tools don't report on.

Is it Beneficial to Build or Have JavaScript Backlinks?

Yes. Since Google treats all links coming to a page as backlinks, regardless of whether they're coming from HTML or JavaScript, having JavaScript backlinks is a good thing.

HTML Link

However, all the caveats around building links still apply. You don't want to build spammy backlinks to your website.

You also don't want to build JavaScript backlinks that somehow subvert Google's guidelines and best practices.

We've mentioned that you shouldn't hack other websites to hide backlinks in JavaScript before, but I wanted to take this opportunity to remind you not to do that. :)

Are JavaScript Backlinks Safe to Have in my Backlink Profile?

Yes. Like Google said, a link is a link is a link. There is no difference between a link that comes from HTML or a link that comes from an element controlled by JavaScript, or from JavaScript code itself.

The only exception is when these links come from malicious code or when JavaScript is abused to insert links to your site.

Why Don't Most SEO Tools Report JavaScript Backlinks?

Because the amount of horsepower required to execute and report on JavaScript backlinks is immense.

That said, as JavaScript becomes more and more ubiquitous (and more SEOs demand to know about which JavaScript backlinks are pointing to their site) and the cost of creating and maintaining servers goes down (as it does every year), we can expect these tools to report on JavaScript backlinks in the near future.

Final Thoughts on JavaScript Backlinks

JavaScript isn't going away. And as JavaScript becomes more popular and prevalent, the need for SEOs to understand which JavaScript backlinks point to their sites only increases.

JavaScript backlinks appear on many traditional on-page elements like lightboxes, drop-down menus and dynamically inserted content.

With a few rare exceptions, Google crawls these elements and indexes these links as if they were normal HTML links.

I wouldn't ignore them.