Skip to content

Are Your Internal Links in the HTML? How to Check JS-Injected Links

By Lazarina Stoy · 9 min read
Are Your Internal Links in the HTML? How to Check JS-Injected Links: illustration of a web page turned into a structured table. An MLforSEO guide by Lazarina Stoy.

Most internal linking plans assume that once a link is on the page, search engines can see it. Yet plenty of internal links never appear in the HTML your server sends. A related-products block fills in after the page loads, a link-insertion app wraps keywords in links from a script, a single-page app builds its menu in the browser, and a product card that looks like a link turns out to be a div with a click handler.

None of this shows when you look at the page. It shows when you compare the raw HTML with the rendered page, link by link, which is what the free internal link checker I built for this tutorial does, in your browser.

Free tool

Internal Link Checker: Raw HTML vs Rendered Page: see which internal links are in your server HTML, which only appear after JavaScript runs, and which Google can’t follow.

On this page
  1. Raw HTML vs the rendered page
  2. What makes a link crawlable
  3. Where JavaScript-only links come from
  4. How to check a page with the free checker
  5. Reading the results
  6. What to fix first
  7. Limits worth knowing
  8. Where this fits in an internal link audit
  9. Frequently asked questions

Raw HTML vs the rendered page

The raw HTML is what your server returns for a URL, the thing you see in View Source. The rendered page is the document after the browser has run the page’s JavaScript, the thing you see in the Elements panel of DevTools. On a JavaScript-heavy site they can hold very different links.

Google reads both. Its JavaScript SEO basics guide explains that Googlebot first parses the HTML response for links, then queues the page for rendering, and after rendering parses the rendered HTML for links again. A page may wait in that queue for a few seconds, and the guide adds that it can take longer. The same page recommends server-side or pre-rendering because not all bots can run JavaScript.

So links added by JavaScript aren’t invisible to Google. They arrive later, and only if rendering works. For crawlers that don’t run JavaScript, which is why my AI crawlers glossary entry recommends server-rendered pages, the raw HTML is all there is, whichever AI crawlers you allow.

Google’s rule is short. In Make your links crawlable it says it can generally only crawl a link that is an <a> element with an href attribute. It also says links inserted with JavaScript are crawlable as long as they use that same markup. Here’s how the common patterns fall out.

PatternExampleCan Google follow it?
An <a> with an href<a href="/trail-shoes/">Yes
An href plus an onclick<a href="/shoes/" onclick="track()">Yes, the href is what counts
An <a href> added by JavaScriptinserted after the page loadsYes, once the page is rendered
No href<a class="menu-toggle">Menu</a>Not reliably
A javascript: URL<a href="javascript:void(0)">Not recommended by Google
A click handler on another element<span onclick="location.href='/size-guide/'">Not reliably
Hash only, or a hash route<a href="#">, <a href="#/products">No new URL to crawl

Same-page jumps such as #sizing in a table of contents are fine. They point at a section of the page you’re on, so the checker lists them separately and doesn’t count them as problems.

The usual sources:

  • Link-insertion apps and scripts that add links in the browser. They’re quick to set up, and the links exist only after rendering.
  • Platform features. Shopify’s own related products documentation says the recommendations are loaded asynchronously with JavaScript.
  • Personalised widgets such as “recommended for you”, replacing a server-rendered list.
  • Single-page apps and mega menus built from data in the browser, where a link may arrive without an href and get one from the router.

How to check a page with the free checker

The Check a page panel of the free internal link checker: snippet tab with four steps, a Check internal links bookmarklet button, Copy console snippet, a box for the JSON and Try the sample page
The checker's snippet mode: drag the button to your bookmarks bar, run it on your page, then paste the JSON it copies (free tool on academy.mlforseo.com).

There’s no URL box in the checker, on purpose. Browsers don’t let a web page download another site’s HTML (a security rule called CORS), so tools that accept any URL fetch it on their own server. This one stays in your browser and gives you two ways in.

Option 1: the snippet, on a page you can open

A test page with an overlay from the snippet: 14 internal links, 7 in the raw HTML, 5 only after JavaScript, 2 not crawlable, with a list of the affected links
The snippet's summary on a local test page that injects links with JavaScript: it caught the injected nav link, related links, a keyword link, an href added by script, a delayed link and an onclick span (headless Chrome test, 5 Dec 2026).
  1. Drag the Check internal links button from the checker to your bookmarks bar, or copy the console snippet.
  2. Open the page you want to check, ideally logged out or in a private window, and scroll to the bottom so lazy-loaded blocks appear.
  3. Click the bookmark, or paste the snippet into the browser console and press Enter.
  4. Read the summary that appears on the page, then press Copy JSON for the tool and paste it into the checker for the full table.

The snippet downloads the page’s own HTML again, which works because it’s the same site, parses it without running any scripts, and compares every link in it with the live page. Nothing is sent anywhere. I tested it on a local page that injects links in four ways, one after a delay, and it classified each correctly.

Option 2: paste mode, for any page

Paste the page’s View Source HTML into the first box. For the second, open DevTools, right-click the <html> element in Elements and choose Copy, then Copy outerHTML. If you want Google’s own view instead of your browser’s, paste the HTML from URL Inspection in Search Console into the rendered box.

Reading the results

Checker verdict 'Fix the links Google can't follow first' with tiles: 24 internal links, 13 in the raw HTML, 6 only after JavaScript, 5 not crawlable, 1 gone after JavaScript
The verdict and counts for the built-in sample page, a fictional running shop's blog post before and after its JavaScript.

The checker ships with a sample page: a blog post on a fictional running shop, before and after its JavaScript. Press Try the sample page and you get a verdict, five counts and a table. On the sample, the counts read 24 internal links, 13 in the raw HTML, 6 only after JavaScript (5 of them to URLs the raw HTML never links to), 5 not crawlable and 1 gone after JavaScript.

The verdict puts the fixes in order: the links Google can’t follow, then the JavaScript-only links, then the link the script removed.

The table: what each column tells you

Link table filtered to Only after JavaScript: seven rows with path, anchor text, raw HTML, rendered, crawlable, where on the page and notes
The table filtered to links that only exist after JavaScript; the notes say whether each URL is linked anywhere in the raw HTML (built-in sample page).
  • Raw HTML and Rendered: whether the link exists in each version, and how many times. “Yes, no href” means the element is there but isn’t a working link.
  • Crawlable: Yes, No, After JS (crawlable only in the rendered page) or Same page.
  • Where: the nearest landmark around the link, nav, header, content, aside or footer, or a class such as “menu” or “sidebar” when the theme doesn’t use landmarks.
  • Notes: why a link isn’t crawlable, and whether a JavaScript-only link’s URL is linked anywhere else in the raw HTML.

That last note matters. On the sample, the link app’s keyword link on “trail running” points to a category the menu already links in the raw HTML, so crawlers still find that URL. The new “Carbon-plate shoes” menu item and the related products point to URLs the raw HTML never mentions, so those pages rely on rendering to be found from here. And the footer’s “Find a store” link is an <a> without an href until the site’s router adds one.

A clean result: mlforseo.com

The mlforseo.com homepage with the checker's summary: 76 internal links, 76 in the raw HTML, 0 only after JavaScript, 0 not crawlable
A clean result: every internal link on the mlforseo.com homepage is in the server HTML (snippet run on 5 Dec 2026).

For contrast, I ran the snippet on the mlforseo.com homepage on 5 December 2026: 76 internal links, all 76 in the raw HTML, none added by JavaScript and none uncrawlable. On my post on ways to automate internal linking it found 79 internal links, all in the raw HTML, plus 29 same-page jumps from the table of contents. That’s WordPress rendering on the server, and the result to aim for.

What to fix first

  1. Not crawlable. Turn each one into a real <a href>. These are usually template fixes, so one change can fix every page.
  2. JavaScript-only links to URLs the raw HTML never links to. Move them into the server HTML: a server-rendered template block, a link saved into the content, or a rule applied before the page leaves the server.
  3. JavaScript-only links whose URL is linked elsewhere. Lower priority, as the URL is discoverable, though the anchor text and the context in the body copy still arrive late.
  4. Gone after JavaScript. Check it’s intended: Google indexes the rendered page, which won’t contain the link.

Re-run the check after each fix and keep the CSV with your internal link audit.

Limits worth knowing

  • One page at a time: check one page per template (post, category, product, homepage).
  • The snippet re-fetches the page with your cookies, so check logged out.
  • It sees what your browser rendered. Googlebot’s render can differ, which is what paste mode with URL Inspection is for.
  • It can’t see click listeners attached to a div without any attribute, or links inside iframes and shadow DOM.
  • If a site blocks the bookmark from running, the console snippet does the same job.

For a whole site, use a crawler that renders JavaScript. If that’s Screaming Frog, the automation post above mentions its uncrawlable links filter, and my guide to scraping page content with Screaming Frog covers custom extraction.

An internal linking audit asks which pages should link to which, with what anchor and how prominently. This check asks a narrower question: do the links you already shipped exist where crawlers read them? Ask it before you measure anything. If you’re still planning the structure itself, start with search intent-first website architecture and blog site architecture for AI search.

In AI-powered Internal Linking Audit and Automation, Sam Torres takes you from a crawl and embeddings to a ranked, explained link menu. In Module 5, my guest module, we ship that menu on WordPress, headless and static sites, Shopify and Webflow in ways that put the links in the HTML, with a dry run and an undo plan for each, and then measure the change. The checker is the quick test you run at the end of each of those builds.

Frequently asked questions

Does Google follow internal links added with JavaScript?

Yes, if they’re <a> elements with an href. Google finds them when it renders the page, which can happen some time after the crawl, and other crawlers may never run the JavaScript at all.

Are onclick links bad for SEO?

An onclick on a real link with an href is fine. An onclick on a span, a div or an <a> without an href is the problem: Google can’t reliably extract a URL from it.

What’s the difference between an internal link checker and an internal link audit?

A checker tests whether the links on a page can be crawled. An audit looks at the whole site: which pages get links, from where, with what anchors. The checker is the quicker first step.

Can I check a page on a site I don’t own?

Yes, with paste mode: copy its View Source HTML and its rendered HTML from DevTools into the two boxes. The snippet only works on the page it runs on.

Free tool

Internal Link Checker: Raw HTML vs Rendered Page: run it on one page per template and fix the links Google can’t follow first.

MLforSEO Academy

Pick your learning path

Start with the course that goes deepest on this article, then more courses taught by Lazarina Stoy, most relevant first.

Recommended with this article

AI-powered Internal Linking Audit and Automation

by Sam Torres with Lazarina Stoy

Audit how your site links to itself, find the pages and entities your links leave out, and plan and automate the fixes with AI at scale.

View course · €350 →

Introduction to Machine Learning for SEO

by Lazarina Stoy

Go from zero to running your first ML workflows for SEO: classification, clustering, entity extraction, fuzzy matching and content transformation.

View course · €250 →

Semantic AI-powered SEO Keyword Research

by Lazarina Stoy with Beatrice Gamba

Build a semantic keyword universe and an automated content-brief workflow, from query understanding through SERP analysis to delivery.

View course · €400 →

AI Search & LLMs: Entity SEO and Knowledge Graph Strategies for Brands

by Beatrice Gamba with Lazarina Stoy

Win in both traditional Google and LLM-driven search by mastering entities, brand recognition, and knowledge graph integration.

View course · €200 →

The AI-powered Entity Audit

by Lazarina Stoy

A complete, repeatable entity audit you can run on any site. Built on the 5Cs of entity representation and demonstrated end to end on a real, unedited site.

View course · €150 →
Bundle & save up to €200 →See all 6 courses →Already an Academy member? Use Community30 for 30% off your next course or bundle.