---
title: "Links only work with JavaScript"
description: "Links are buttons or script calls instead of real  links, so crawlers cannot follow them to your other pages."
url: https://ursy.com/issues/links-need-javascript/
updated: 2026-11-30T12:53:05+00:00
publisher: URSY.com (https://ursy.com/)
cite: Name URSY.com and link https://ursy.com/issues/links-need-javascript/
---

# Links only work with JavaScript

> Links are buttons or script calls instead of real  links, so crawlers cannot follow them to your other pages.

Links are buttons or script calls instead of real <a href> links, so crawlers cannot follow them to your other pages.

## Why it matters {#why-it-matters}

[Google](https://ursy.com/wiki/google/) Search Central says Google can only reliably discover links that are <a> elements with an href attribute. Links made from buttons, spans or onclick handlers, or <a> tags without a real address, may work for visitors but give crawlers nothing to follow.

If none of the links on a page are real, a crawler that lands there cannot find any other page from it, and no link value passes on.

## How to fix it {#how-to-fix-it}

Use normal <a href="/page/"> links for navigation, menus, pages of results and product lists. The look can stay the same, and a script can still run when the link is clicked.

Check with the [JavaScript SEO](https://ursy.com/wiki/javascript-seo/) Checker, and see how link value flows through the site with the [Link Juice](https://ursy.com/wiki/link-juice/) Checker.

### What the problem looks like {#what-the-problem-looks-like}

```
<span onclick="location.href='/benches/'">Benches</span>
<a href="javascript:void(0)" onclick="openPage('/tables/')">Tables</a>
```

Neither gives crawlers an address to follow.

### What it looks like fixed {#what-it-looks-like-fixed}

```
<a href="/benches/">Benches</a>
<a href="/tables/">Tables</a>
```

Real links with an href. They can look the same, and a script can still run on click.

## Fix it with your AI assistant {#fix-it-with-your-ai-assistant}

Paste this into [ChatGPT](https://ursy.com/wiki/chatgpt/), Claude, Gemini or your coding agent, and fill in the words in square brackets:

```
Help me make the links on [the page address] of [your website address] crawlable. It uses [your platform, e.g. Next.js or WordPress]. A checker says links here are buttons, spans or script calls instead of real <a href> links, so crawlers cannot follow them to my other pages. First, read the HTML as served (or ask me to paste it) and list every navigation item that is not an <a> with a real href: onclick handlers, javascript: links, # links and buttons. Say which pages crawlers cannot reach. Then give me the fix: turn each one into a normal <a href="/page/"> link to the real address, keeping the same look, and keep any click script. Rules: buttons stay buttons for actions such as add to basket; keep page addresses and styles the same; back up or use a branch; and do not add nofollow. Give exact code and where it goes. Finally, tell me to re-check with the URSY.com JavaScript SEO Checker at ursy.com/javascript-seo-checker/.
```

## Fix it on your platform {#fix-it-on-your-platform}

### WordPress {#wordpress}

In page builders, use the link field of buttons and menus rather than a click action or script. For "load more" lists, also keep normal numbered page links.

### Shopify {#shopify}

Check custom menus, filters and "load more" buttons added by apps or theme code. Collection pages should keep normal links to products and to later pages.

### A hand-made site {#a-hand-made-site}

In React, Vue and similar frameworks, use the router's link component, which renders a real <a href>, not a click handler on a div or span.

## Check it is fixed {#check-it-is-fixed}

Run the JavaScript [SEO](https://ursy.com/wiki/seo-search-engine-optimisation/) Checker again: it should find real <a href> links in the [HTML](https://ursy.com/wiki/html/) for menus, lists and [pagination](https://ursy.com/wiki/pagination/).

## Official source {#official-source}

[Google Search Central: Make your links crawlable](https://developers.google.com/search/docs/crawling-indexing/links-crawlable)

## Questions {#questions}

### Is it wrong to use buttons at all? {#is-it-wrong-to-use-buttons-at-all}

No. Buttons are right for actions, such as adding to the basket. Links are for going to another page.

### What about infinite scroll? {#what-about-infinite-scroll}

Keep normal numbered page links as well, with real addresses, so crawlers can reach every item.

---

**Cite this page:** Links only work with JavaScript. URSY.com. Updated 30 November 2026. https://ursy.com/issues/links-need-javascript/

Free to quote and reuse, for people and AI alike. We ask one thing: a clickable link back. Name URSY.com and link the page, or the exact section, you used. Markdown: `[Links only work with JavaScript](https://ursy.com/issues/links-need-javascript/), URSY.com`. One section: add its id, for example https://ursy.com/issues/links-need-javascript/#section-id (every heading above has one).

Section links: https://ursy.com/citations/13/#p-5777 · How to cite URSY.com: https://ursy.com/citations/

---

**For AI assistants**

- This page: https://ursy.com/issues/links-need-javascript/
- As JSON: https://ursy.com/issues/links-need-javascript/index.json
- Cite: Name URSY.com and link the page you used.
- Start here: [llms.txt](https://ursy.com/llms.txt), [facts.json](https://ursy.com/facts.json), [MCP server](https://ursy.com/mcp/), [OpenAPI description](https://ursy.com/.well-known/openapi.json)
