Fix guides · SEO
How to fix “Links are not crawlable”
Links built with JavaScript click handlers instead of a real address are invisible to search engines, so the pages they lead to may never be found. How to fix them.
- Time to fix
- 15–45 minutes
- Skill needed
- Developer
- Who notices
- Search engines finding your pages, and keyboard users
Why it matters
Search engines discover pages by following <a> elements with an href address. Links that use href="javascript:…", href="#" with an onclick, or no href at all aren't followed.
Those links often don't work with a keyboard or "open in new tab" either.
“Generally, Google can only crawl your link if it's an <a> HTML element (also known as anchor element) with an href attribute.”
Before you start
- Your report lists each link. Give each one a real address in href, and keep any JavaScript as an extra on top.
- If it's an action rather than navigation (opening a menu, adding to cart), use a <button> instead of a link.
Fix it on your platform
Shopify
- Shopify's theme accessibility guidance says to use <a> for navigation and <button> for on-screen actions. Fix links in your theme code that lack a real href, or ask your theme developer.
- If an app's widget is listed, contact the app's developer.
WordPress
- Links added in the editor are fine. Check menus, sliders and page-builder buttons from your theme or plugins; many have a link field that's been left empty or set to #.
Webflow
- Select each flagged Link Block or Button and set its link to a page, URL or section instead of leaving it empty. Use a Div Block with an interaction for things that aren't links.
Wix
- Select the flagged button or text and set a link to a page or URL in its link settings. If the link comes from custom code, give it a real href.
Squarespace
- Edit the flagged button or link and choose a page or URL as its destination. Check code blocks and code injection for links without an address.
Next.js
- Use next/link for navigation (it renders a real <a href>), not a div or button with router.push().
<Link href="/shoes">Shoes</Link>
// Not crawlable:
<span onClick={() => router.push("/shoes")}>Shoes</span>Any other site
- Give every link a real address.
<!-- Not crawlable -->
<a onclick="goTo('shoes')">Shoes</a>
<a href="javascript:goTo('shoes')">Shoes</a>
<!-- Crawlable -->
<a href="/products/shoes">Shoes</a>Check that it's fixed
- Right-click each link and choose "Open in new tab": it should open the right page.
- Re-run your StudioLNC audit: the links should no longer be listed.
Find every issue like this on your site
Free audit of performance, accessibility, SEO and security, with fixes for your platform.