Skip to content
atlookup

Link Uses javascript: URL

javascript:void(0) links are not crawlable, open in weird ways, and fail when JavaScript is disabled.

notice Impact: medium WCAG 2.1.1 (Level A) LINK_JAVASCRIPT_HREF 2 min read Updated

Why it matters

javascript:void(0) links are not crawlable, open in weird ways, and fail when JavaScript is disabled. They also block middle-click-to-open-in-new-tab.

Address when convenient — notices usually mark a polish opportunity rather than a defect. Estimated SEO impact: medium — measurable effect on click-through or relevance.

How to fix

  • Use a real URL in href and attach the JS handler with addEventListener
  • For pure buttons, use <button> instead of <a>

Common causes

If the rule is firing across many pages, the root cause is almost always one of these:

  • Old anchor text ("click here", "read more") survives template refactors.
  • Migration changes URLs but leaves internal links pointing at the old paths.
  • Footer or sidebar widgets reference removed pages that haven't been re-pruned.
  • Generated category/tag pages create orphaned link clusters.

Anti-patterns to avoid

Even with the best intentions, these "fixes" make the issue worse — recognise them so you don't ship them:

  • Anchor text "click here" / "read more" / "this link".
  • Linking the same anchor to multiple destinations within one page.
  • Hiding important internal links behind onclick handlers without an href.

Example

Here's a typical instance — the problematic line is highlighted in red:

example.html HTML
<a href="javascript:/img/example.jpg">Open</a>

And the fix — the corrected line, highlighted in green:

example.html HTML · fixed
<a href="/img/example.jpg">Open</a>

How atlookup detects this

Our crawler renders each page with a real headless browser, then normalises every internal href, follows redirects, and grades anchor descriptiveness. Pages where the rule fires for link uses javascript: url are flagged on the report.

If you'd like to see this rule fire on your own site, run a free 60-second audit — every page is reported with the exact lines that triggered it.

Tools to verify the fix

Once you've applied the fix, double-check with these external validators:

Frequently asked questions

Why does Link Uses javascript: URL matter for SEO?

javascript:void(0) links are not crawlable, open in weird ways, and fail when JavaScript is disabled. They also block middle-click-to-open-in-new-tab.

How do I fix link uses javascript: url?

Use a real URL in href and attach the JS handler with addEventListener For pure buttons, use <button> instead of <a>

Is this a critical SEO issue?

Address when convenient — notices usually mark a polish opportunity rather than a defect. Estimated SEO impact: medium — measurable effect on click-through or relevance.

How does atlookup detect link uses javascript: url?

Our crawler renders each page with a real headless browser, then normalises every internal href, follows redirects, and grades anchor descriptiveness. Pages where the rule fires for link uses javascript: url are flagged on the report.

Does this affect accessibility?

Yes. This issue maps to WCAG 2.1.1 (Level A). Fixing it improves both SEO ranking signals and the experience for users on assistive technology.