How to Fix “Links are not crawlable” in Lighthouse
If Lighthouse's SEO audit reports "Links are not crawlable" (displayed in Japanese in the Japanese UI), write the destination URL directly in the href of each <a> element in the table. This audit appears on sites that switch screens with JavaScript (SPAs) when an <a> has href set to javascript:void(0), or has no href and handles the click with onclick. It checks whether search engines can find other pages through the link.
I built a test page with nine links written in different ways. I ran Lighthouse to see which ones appeared in the table and which did not, then confirmed that the warning disappeared on the fixed page and that clicking the links behaved correctly.
The test environment was Ubuntu 24.04, Node.js 22, and Lighthouse 13.6.0 (the npm package). I ran Lighthouse from the command line with the default settings (mobile), limited to the SEO category. I used Chrome for Testing 153, bundled with Playwright 1.63.0, and served the pages from localhost with a small server written using Node.js's http module. I did not test whether Google Search actually crawls the pages, the Lighthouse panel in DevTools, PageSpeed Insights, or router features in frameworks such as React. The Google help page linked from the Lighthouse report could not be opened from my test environment, so this article is based on Lighthouse's own explanation and code.
Only 4 of the 9 links appeared in the table
The links on the test page are as follows. The product list, About, News, and FAQ links only call the JavaScript function go() to rewrite the heading when clicked. The URL does not change.
<nav>
<a href="javascript:void(0)" onclick="go('/products')">商品一覧</a>
<a onclick="go('/about')">お店について</a>
<a class="js-link" data-to="/news">お知らせ</a>
<a href="file:///C:/shop/catalog.pdf">カタログ(PDF)</a>
<a href="javascript:go('/faq')">よくある質問</a>
<a href="#" id="menu-open">メニュー</a>
</nav>
<main>
<h1 id="title">トップ</h1>
<a href="javascript:void(0)" role="button" id="add-cart">カートに入れる</a>
<p>ページ:<a>1</a> <a href="/?page=2">2</a></p>
</main>
For "News," I did not use an HTML attribute. Instead, I added a click handler with addEventListener('click', …) in app.js. "Menu" and "Add to cart" work the same way: clicking them only changes part of the screen.
I ran Lighthouse on this page and used a small script (summarize.mjs) to extract the result for this audit (crawlable-anchors) from the JSON report.
$ npx lighthouse http://localhost:8100/ --only-categories=seo --output=json --output=html --output-path=./out/broken --chrome-flags="--headless=new --no-sandbox" --quiet -GA=./out/broken-artifacts
exit: 0
$ node summarize.mjs out/broken.report.json
lighthouseVersion: 13.6.0 formFactor: mobile locale: en-US
seo score: 90
failed in seo: crawlable-anchors (weight 1)
crawlable-anchors: score=0 title="Links are not crawlable"
item: <a href="javascript:void(0)" onclick="go('/products')">
item: <a onclick="go('/about')">
item: <a class="js-link" data-to="/news">
item: <a href="file:///C:/shop/catalog.pdf">
The SEO score was 90, and this was the only audit that failed. In the HTML report, the table heading is "Uncrawlable Link" (displayed in Japanese in the Japanese UI), and the link text and HTML are listed next to each other.

The Lighthouse report explains that search engines may use the href attribute of links to crawl a site. The goal of this audit is to have a URL in href so that other pages on the site can be found.
How Lighthouse 13.6.0 fails and passes links
Here is how Lighthouse judged all nine links, including the five that did not appear in the table. I confirmed the logic in the Lighthouse 13.6.0 code published on GitHub.
| Link | Result | Reason (13.6.0 code) |
|---|---|---|
href="javascript:void(0)" |
Fail | Matches the form javascript:void(0) |
No href + onclick attribute |
Fail | No href, and one or more event listeners exist |
No href + addEventListener |
Fail | No href, and one or more event listeners exist |
href="file:///…" |
Fail | Starts with file: |
href="javascript:go('/faq')" |
Pass | Does not match javascript:void(0), and can be read as a URL |
href="#" + click handler |
Pass | Can be read as a URL |
role="button" + javascript:void(0) |
Pass | Links with a role attribute are not checked |
<a>1</a> with no href and no listener |
Pass | Treated as an element placed in place of a link |
href="/?page=2" |
Pass | Can be read as a URL |
For <a> elements without href, the result depended on whether an event listener was attached. The listeners in this test were all for click. Lighthouse caught them whether they were set with the onclick attribute or with addEventListener, and both failed. In the 13.6.0 code, any one listener of any type causes a fail, as long as the element has no attributes that are used together with href, such as target or rel. An <a> with neither href nor a listener, such as the "current page" marker in pagination, does not appear in the table.
Some links that passed have no destination URL. javascript:go('/faq') does not match the javascript:void(0) form and can be read as a URL, so it passed. href="#" and the role="button" link also pass. Passing the audit does not mean the link points somewhere useful, so you need to check yourself that href contains a real destination.
The 13.6.0 code also skips mailto: links, <a> elements with a name attribute (except those starting with file:), and <a> elements with an id and no href (or an empty one), such as <a id="top"> used as an in-page anchor. It fails when the content of href cannot be read as a URL.
For links that navigate, put a URL in href and switch with JavaScript
For links that move to another page (product list, About, News, FAQ), write the destination path in href.
<a href="/products">商品一覧</a>
<a href="/about">お店について</a>
<a href="/news">お知らせ</a>
<a href="/faq">よくある質問</a>
If you want to switch screens without reloading the page, keep href as it is and handle only the click with JavaScript. In the test, I attached a single listener to document instead of one per link.
// Keep the href as it is, and only switch the screen with JavaScript when it is clicked.
function render() {
document.querySelector('#title').textContent = location.pathname === '/' ? 'トップ' : location.pathname;
}
document.addEventListener('click', (e) => {
const a = e.target.closest('a[href^="/"]');
// Leave PDFs, Ctrl or Shift clicks, and middle-clicks to the browser.
if (!a || a.pathname.endsWith('.pdf') || e.button !== 0 || e.ctrlKey || e.metaKey || e.shiftKey) return;
e.preventDefault();
history.pushState(null, '', a.href);
render();
});
window.addEventListener('popstate', render);
// Show the first screen based on the URL when the page is opened.
render();
history.pushState() changes the page's URL and history, but it does not load that URL. However, MDN notes that the URL may be loaded later, for example after the browser is restarted. So that /products and similar paths still return a page when opened directly, I made the server return index.html for paths without a file extension.
I opened the page before and after the fix in Playwright and clicked the links to check the behavior.
-- broken
click 商品一覧: path=/ h1=/products notReloaded=true
click お店について: path=/ h1=/about notReloaded=true
click お知らせ: path=/ h1=/news notReloaded=true
ctrl+click 商品一覧: new tab なし
-- fixed
click 商品一覧: path=/products h1=/products notReloaded=true
click お店について: path=/about h1=/about notReloaded=true
click お知らせ: path=/news h1=/news notReloaded=true
ctrl+click 商品一覧: new tab url=/products h1=/products
back: path=/about h1=/about
open /news directly: h1=/news
notReloaded=true means the page was not reloaded. The value I put on window when the page first opened was still there. Before the fix, the heading changed but the URL stayed at /, and Ctrl+click did not open a new tab. After the fix, the URL changed to /products and so on, and Ctrl+click opened /products in a new tab. Pressing the browser's Back button returned to the previous screen, and opening /news directly showed the screen with the heading /news.
For the catalog PDF, I removed the file: path, placed the file on the server, and changed the link to href="/catalog.pdf".
Links that do not navigate should be buttons
"Menu" and "Add to cart" do not go to another page when clicked. I replaced their <a> elements with <button> elements.
<button type="button" id="menu-open">メニュー</button>
<button type="button" id="add-cart">カートに入れる</button>
Lighthouse did not flag these two even in their original form. However, MDN's description of the <a> element lists using # or javascript:void(0) in href to act as a button as a misuse, and recommends using <button> instead. The reason is that operations such as copying the link or opening it in a new tab can behave unexpectedly. Adding role="button" makes the audit pass, but for things that do not navigate, using <button> is the straightforward choice.
Results after the fix
After the fix, Lighthouse passed this audit ("Links are crawlable", displayed in Japanese in the Japanese UI), and the SEO score became 100. I ran it twice and got the same result both times.
$ node summarize.mjs out/fixed.report.json
lighthouseVersion: 13.6.0 formFactor: mobile locale: en-US
seo score: 100
crawlable-anchors: score=1 title="Links are crawlable"
This audit has a weight of 1 in the SEO score, the same as the other eight audits, excluding is-crawlable (93/23) and structured-data (0), which is checked manually (13.6.0 settings).





