# Use crawlable HTML links

- Check 02.08 · Architecture and navigation · Critical
- Source: https://checklist-seo-geo.com/en/architecture-navigation/use-crawlable-html-links
- Make sure your navigation relies on crawlable a href links: a console audit, then fixes for CMSs, Laravel, Next.js and Nuxt.
- Updated on 2026-11-25
- Licence: CC BY 4.0. Credit “Checklist SEO & GEO” with a link to https://checklist-seo-geo.com/en/architecture-navigation/use-crawlable-html-links.
- Plugin checklist-seo-geo: 1.3.1 · https://github.com/maximegaul/checklist-seo-geo

## In short

A crawlable link is an `<a>` element with an `href` attribute containing a real URL, present in the HTML. It is the only form of link that search engines follow reliably. The task is to spot everything used for navigation that is not one (cards made clickable with JavaScript, `href="#"`, buttons that change page, links that only appear after an interaction) and replace it. Once done, every page on the site can be reached by following `<a href>` links alone.

## Why it matters

Google's documentation is explicit: Google can generally only crawl a link if it is an `<a>` element with an `href` attribute, and the URL must resolve into an actual web address. It gives these examples:

| Google can parse | Not recommended, even if Google sometimes tries to interpret it |
|---|---|
| `<a href="https://example.com">` | `<a routerLink="products/category">` |
| `<a href="/products/category/shoes">` | `<span href="https://example.com">` |
| `<a href="./products/category/shoes">` | `<a onclick="goto('https://example.com')">` |
| `<a href="/products/category/shoes" onclick="javascript:goTo('shoes')">` | `<a href="javascript:goTo('products')">` |

Three points from Google complete this table:

- **Links inserted with JavaScript are accepted** if they take this `<a href>` form. But discovery can happen twice, before and after scripts run: links present in the server's initial response are found faster.
- **Bots do not click.** In its e-commerce documentation, Google advises against using JavaScript events on other elements for navigation, and states that its bots generally do not trigger functions that require user action.
- **Fragments (`#`) are not pages.** Google advises against changing a page's content using the URL fragment; use the History API for JavaScript applications.

Other bots are often less capable than Googlebot. A study published by Vercel and MERJ in December 2024 found that the main AI crawlers measured, including those of OpenAI, Anthropic and Perplexity, did not execute JavaScript. For them, a link that only exists after rendering does not exist.

Anchor text matters too: Google uses the link text, or the `alt` attribute of a linked image, to understand the target page.

## What it improves

- **Page discovery** by all bots, including those that do not run JavaScript.
- **Indexing** of categories, product pages and articles linked only through clickable components.
- **Passing context** to target pages through anchor text.
- **Accessibility**: opening in a new tab, screen readers, keyboard navigation, copying the link.
- **Reading by AI assistants**: navigation paths readable without rendering. A plausible effect, not proven.
- **Rankings**: an indirect effect, through crawling and internal linking.

## How to check

**1. Count the links in the initial HTML and in the rendered DOM.** On a category page or a list of articles:

```bash
curl -s https://example.com/the-vert/ | grep -o '<a [^>]*href="[^"#][^"]*"' | wc -l
```

Then, in the browser console on the same page: `document.querySelectorAll('a[href]:not([href^="#"]):not([href^="javascript:"])').length`. A large gap means links are added by JavaScript. See [compare initial HTML and rendered DOM](https://checklist-seo-geo.com/en/javascript-html-rendering/compare-initial-html-rendered-dom).

**2. Spot fake links.** Paste into the console:

```js
const isRealLink = (el) => el.closest('a[href]:not([href^="javascript:"]):not([href="#"]), button, input, select, label, summary');

const suspects = [
  ...document.querySelectorAll('[onclick], [role="link"], [data-href], [data-url], a:not([href]), a[href="#"], a[href^="javascript:"]'),
  ...[...document.querySelectorAll('body *')].filter((el) => getComputedStyle(el).cursor === 'pointer' && !isRealLink(el)),
];

console.table([...new Set(suspects)].map((el) => ({
  tag: el.tagName.toLowerCase(),
  text: el.textContent.trim().slice(0, 60),
  href: el.getAttribute('href'),
  onclick: el.getAttribute('onclick'),
  data: el.dataset.href || el.dataset.url || '',
})));
```

Each row is a clickable element that is not a real link: one to examine. Event handlers added by React or Vue do not appear as attributes, but the hand-shaped cursor gives them away.

**3. See the page as Google does.** In Search Console, URL Inspection tool, `Test live URL`, then `View tested page` and the HTML tab: look for the navigation links there.

**4. Crawl without JavaScript.** Crawl the site with Screaming Frog in text mode (the default): pages it does not find, even though they exist, are linked through non-crawlable links. See [detect orphan pages](https://checklist-seo-geo.com/en/architecture-navigation/detect-orphan-pages).

Compliant result: no navigation elements in the list of suspects, and the navigation links present in the initial HTML.

## How to implement

### Before you start

How to choose between a link and a button:

| The element… | Use | Example |
|---|---|---|
| leads to another page or another URL | `<a href="/url/">` | Product page, category, page 2, article |
| acts on the page without changing the URL | `<button type="button">` | Open a menu, add to cart, show a filter |
| sends data | `<button type="submit">` in a `<form>` | Search, sign-up |

Typical fixes:

```html
<!-- Before: card made clickable with JavaScript -->
<div class="card" onclick="location.href='/the-vert/sencha/'">Sencha</div>

<!-- After: a real link -->
<a class="card" href="/the-vert/sencha/">Sencha</a>

<!-- Before: pagination with buttons -->
<button onclick="loadPage(2)">2</button>

<!-- After: links to real URLs, enhanced with JavaScript if needed -->
<a href="/the-vert/?page=2">2</a>
```

For a card that contains several elements (image, title, price), use only one link, on the title, and extend its clickable area to the whole card:

```css
.card { position: relative; }
.card a.card-link::after { content: ""; position: absolute; inset: 0; }
```

```html
<article class="card">
  <img src="/img/sencha.webp" alt="" width="400" height="300">
  <h3><a class="card-link" href="/the-vert/sencha/">Sencha Kagoshima bio</a></h3>
  <p>€12.90 per 100 g</p>
</article>
```

Other rules:

- **Linked image**: provide an `alt` that describes the destination, or add text inside the link.
- **No `nofollow`** on internal links to pages you want crawled.
- **Final URLs**: point to the canonical URL, not to a URL that redirects. See [fix links to redirects or non-canonical URLs](https://checklist-seo-geo.com/en/internal-linking/fix-links-redirects-non-canonical-urls).
- **In-page anchors**: `href="#section"` is still fine for jumping to a section of the same page; the problem is a `#` used as a fake link or to load other content.
- **Angular**: a `routerLink` placed on an `<a>` element produces an `href` once rendered; with server-side rendering, it is in the initial HTML. On any element other than an `<a>`, it produces none.

### WordPress

Versions: WordPress 6.4 and later, WooCommerce 9 and 10, November 2026.

Menus, post lists and native blocks produce real links. Problems come from page builders, sliders and “clickable card” plugins:

- in page builders, prefer the option that turns the container into a link (HTML tag `a`) over an “on click” option that adds JavaScript;
- check product and post grids generated by plugins with the console script;
- AJAX filters from WooCommerce or third-party plugins must not be the only path to categories: keep links to the categories in the menu or on section pages.

### Shopify

Versions: Online Store 2.0 themes, all Shopify plans, November 2026.

Shopify themes render menus, product grids and pagination in Liquid, with links. Check what has been added: mega menu apps, quick views, color swatches and recommended product carousels that load their links afterwards. Product recommendations loaded through the Section Rendering API arrive after page load: also keep fixed links to important products in the collections.

### Laravel

Versions: Laravel 11 to 13, Livewire 3 and 4, Inertia 2 and 3.

With Blade, generate `<a href="{{ route(...) }}">` links. With Livewire, add `wire:navigate` to a real link rather than using `wire:click` to change page:

```twig
{{-- Avoid --}}
<div wire:click="goToProduct({{ $product->id }})">{{ $product->name }}</div>

{{-- Correct: crawlable link, navigation sped up by Livewire --}}
<a href="{{ route('products.show', $product) }}" wire:navigate>{{ $product->name }}</a>
```

With Inertia, the `Link` component produces an `<a href>`; avoid `router.visit()` in an `onClick` handler for navigation. For pagination, `{{ $products->links() }}` produces crawlable links.

### Next.js

Versions: Next.js 15 and 16 (App Router and Pages Router).

Use `Link`, which produces an `<a>` element with its `href`. Keep `router.push()` (`useRouter` from `next/navigation` with the App Router, from `next/router` with the Pages Router) for redirects after an action (form submission), never for a navigation element:

```tsx
// Avoid: no href, invisible to bots
<div onClick={() => router.push(`/produits/${product.slug}`)}>{product.name}</div>

// Correct
import Link from 'next/link'

<Link href={`/produits/${product.slug}`}>{product.name}</Link>
```

With the App Router, render link lists in server components, so that they are in the initial HTML. With the Pages Router, load the data for these lists in `getStaticProps` or `getServerSideProps` rather than in a `useEffect`, for the same reason. For pagination or tabs, give each state a URL (`?page=2`, `/onglet/`) and a `Link` to it.

### Nuxt

Versions: Nuxt 3 and 4 (Nuxt 3 has been end-of-life since July 2026), Vue Router 4.

`NuxtLink` produces an `<a href>`; `navigateTo()` in an `@click` does not. Same rule with Vue Router alone: `RouterLink` rather than `router.push()` for navigation.

```html
<!-- Avoid -->
<div @click="navigateTo(`/produits/${product.slug}`)">{{ product.name }}</div>

<!-- Correct -->
<NuxtLink :to="`/produits/${product.slug}`">{{ product.name }}</NuxtLink>
```

Enable server-side rendering (the default in Nuxt) so that the links are in the initial HTML.

### Astro

Versions: Astro 5 to 7.

Astro produces static HTML: `<a href>` links written in `.astro` components are in the initial HTML. The client-side router (`<ClientRouter />`, which replaces the old `<ViewTransitions />` component) keeps real links. The risk is limited to interactive islands (React, Vue, Svelte) loaded with a `client:` directive: do not put the main navigation there, or render it on the server side as well.

### Check after fixing

Run the console script and the `curl` count again on the same pages, then a crawl without JavaScript: the number of pages found should get closer to the number of published pages. Add an automated test that fails if a key template contains a navigation `[onclick]` element or an `a` without `href`. See [integrate SEO tests into CI/CD](https://checklist-seo-geo.com/en/automation-quality-control/integrate-seo-performance-accessibility-tests-into-ci-cd).

> **Good to know:** a link can carry both a real `href` and a JavaScript handler that speeds up navigation. That is what Next.js `Link`, `NuxtLink` or `wire:navigate` do: bots follow the `href`, visitors enjoy client-side navigation.

## Common mistakes

- **Clickable product cards without a link**: a `div` with `onclick` or `router.push`, and the target page is not linked by any `<a href>`.
- **`href="#"` with a script** that loads the intended page: the search engine only sees a link to the current page.
- **`href="javascript:…"`**: not recommended by Google, ignored by most bots.
- **Pagination or “Show more” as a button** with no page URL: the following items are not linked anywhere. See [control pagination and infinite scroll](https://checklist-seo-geo.com/en/architecture-navigation/control-pagination-infinite-scroll).
- **Links that only exist after a hover or a click**: menus, tabs, accordions loaded on demand.
- **Image links without `alt`** or text: a link with no anchor text.
- **Conditional rendering** in a framework: a closed submenu or an inactive tab missing from the DOM.

## Frequently asked questions

### Does Google follow links created with JavaScript?

Yes, if the JavaScript produces real a elements with an href attribute containing a resolvable URL. Google renders pages and can discover these links after scripts run, but links present in the server's initial response are found faster. Clickable elements without an href, or links that only appear after a click, are generally not followed, because Googlebot does not click.

### Can a button be used as a link to another page?

No, search engines do not follow a button as a link, even if it redirects the visitor with JavaScript. Use an a element with an href for anything that leads to another URL, and keep buttons for actions on the page: opening a menu, adding to the cart, submitting a form. With CSS, a link can look like a button without losing its crawlability.

### Are href="#" links a problem for SEO?

Yes, when they are used as fake links. An href="#" combined with a script that loads another page only gives the search engine a link to the current page: the destination is not discovered. On the other hand, a link to an anchor on the same page, such as href="#livraison", is perfectly fine. Google also advises against using the URL fragment to load different content.

### Do AI bots like ChatGPT's follow JavaScript links?

According to a study by Vercel and MERJ published in December 2024, the main AI crawlers measured, including those of OpenAI, Anthropic and Perplexity, did not execute JavaScript. They therefore only see the links present in the initial HTML. This behavior may change: check each vendor's documentation. Server-rendered a href links remain the only approach that every bot can read.

## Resources

- [Google Search Central: Link best practices](https://developers.google.com/search/docs/crawling-indexing/links-crawlable?hl=en)
- [Google Search Central: Understand JavaScript SEO basics](https://developers.google.com/search/docs/crawling-indexing/javascript/javascript-seo-basics?hl=en)
- [Google Search Central: Help Google understand your e-commerce site structure](https://developers.google.com/search/docs/specialty/ecommerce/help-google-understand-your-ecommerce-site-structure?hl=en)
- [Google Search Central: URL structure best practices](https://developers.google.com/search/docs/crawling-indexing/url-structure?hl=en)
- [MDN: the a element](https://developer.mozilla.org/en-US/docs/Web/HTML/Reference/Elements/a)
- [Next.js: Link component](https://nextjs.org/docs/app/api-reference/components/link)
- [Vercel: the rise of the AI crawler](https://vercel.com/blog/the-rise-of-the-ai-crawler)
- [Search Console Help: URL Inspection tool](https://support.google.com/webmasters/answer/9012289?hl=en)

Next steps: [make links available in HTML with href](https://checklist-seo-geo.com/en/javascript-html-rendering/make-links-available-html-href) and [avoid links that rely solely on JS events](https://checklist-seo-geo.com/en/javascript-html-rendering/avoid-links-that-rely-solely-js-events).
