JavaScript Link Onclick Issue

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.

Something went wrong. Please, try again later.
Sitechecker crozdesk rating Sitechecker crowd rating Sitechecker capterra rating
Sitechecker trusted company

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.

Sitechecker also scans for issues of this nature, labeling them as “Notices”.

Onclick Attribute Issue

The service even allows you to find this issue in the code of every specific page.

Onclick Attribute Code

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.

Fixing pages having link with a URL in onclick attribute 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.

Something went wrong. Please, try again later.
Sitechecker rating on crozdesk Sitechecker rating on crowd Sitechecker rating on capterra

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

Something went wrong. Please, try again later.