JavaScript Link Onclick Issue
Fast Links

Free SEO Audit

Crawl the website for technical issues and get a prioritized to-do list with detailed guides on how to fix.

Sitechecker crozdesk rating Sitechecker crowd rating Sitechecker capterra rating
Sitechecker trusted company

JavaScript Link Onclick Issue

The issue notification remarks that a particular URL contains at least one outgoing anchor link with the URL in the onclick attribute.

What Does “JavaScript Link Onclick” Mean?

When using JavaScript links, there is a good chance that search engines (most likely other than Google) will not follow the references. If you work below Google, this probably won’t be a problem for you.

What triggers this issue?

An issue notification will be triggered for any internal URL that contains an outgoing link with the URL in the onclick attribute.

The presence of JavaScript: in any attribute not intended for scripting is a deprecated HTML method. While it does work in practice, you’re still assigning JavaScript properties to a non-script attribute, which is not good practice.

It’s best to add JavaScript to the onclick attribute, which is ignored if you can’t create scripts.

How to check the issue?

Crawlers (special tools for web admins) can check this specific issue. In the report, after scanning, the JavaScript Link Onclick issue will be marked as not serious.

It will not do any harm to your site. Nevertheless, it is considered an error and is placed in the scan report to notify the site owner.

Pages having link with a URL in onclick attribute check is good for your website but not enough to get good SERP positions!

To detect not only the issue but other kind of site level and page level problems, just make the full site audit.

Sitechecker rating on crozdesk Sitechecker rating on crowd Sitechecker rating on capterra

Why is this important?

And although it’s considered just a notification and not a serious error, you should know why it’s important. For a JavaScript link, the onclick attribute specifies the JavaScript action when the user clicks the link (the onclick event for the link happens), and the URL is present in the onclick attribute.

The purpose of the link defines in JavaScript, which can cause problems for search engine robots. Of all the search engines out there, Google handles JavaScript rendering the best. Google sometimes claims to solve the problem with such links.

How to fix the issue?

This issue is simply an alert. You do not have to solve the problem immediately. SEO optimization software simply informs web admins about the error.

Search engines are getting better at interacting with JavaScript every day, but the problem of link handling is still relevant.

You can only conclude whether your JavaScript links work for the search engines by analyzing the link log. Here are a few ways to fix the bug:

  1. Make sure there’s a spare HTML link if you’re leaving JavaScript behind;
  2. Replace JavaScript links with HTML references so that they are accessible to most search engine robots;
  3. If your site’s content relies heavily on JavaScript, you can try serving processed pages to the search engines yourself.

Check Your Website for SEO Errors

Go to App
Something went wrong. Please, try again later.
close