Check 02.08 · Architecture and 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.

Priority
Critical
Difficulty
Intermediate
Estimated time
2 to 6 h
Free, no account: your progress is saved in this browser.

Ask an AI to check this point on your site

Opens the assistant with a ready-made question: this check, its goal and your site URL.

For Gemini, Copilot or another assistant, copy the question. The link opens the chosen service directly: nothing goes through this site.

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:

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 (opens in a new tab).

2. Spot fake links. Paste into the console:

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 (opens in a new tab).

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:

<!-- 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:

.card { position: relative; }
.card a.card-link::after { content: ""; position: absolute; inset: 0; }
<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 (opens in a new tab).
  • 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:

{{-- 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:

// 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.

<!-- 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 (opens in a new tab).

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 (opens in a new tab).
  • 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

Updated on

Topic checklist (PDF)

And now?

In the “Architecture and navigation” topic

  1. Organize pages by topic and hierarchy
  2. Create pillar pages and supporting content
  3. Limit the click depth of strategic pages (three clicks if possible)
  4. Detect orphan pages
  5. Optimize menus and submenus
  6. Implement breadcrumbs
  7. Optimize footer links
  8. Use crawlable HTML links
  9. Create short, stable and descriptive URLs
  10. Separate words with hyphens
  11. Standardize letter case and trailing slashes
  12. Control URL parameters
  13. Control pagination and infinite scroll
  14. Control filters and facets
  15. Avoid infinite URL spaces
  16. Avoid categories that add no value
  17. Check links to commercial pages