SEO JavaScript

Jak Upewnij się wyszukiwarki może crawlowanie, renderować, i indeks Treści zależne od JavaScript — prawdziwe linki, parity, lazy-loading, infinite scroll, soft-404s, i testing.

Opublikowano po raz pierwszy: 23 cze 2026 · Ostatnia aktualizacja: 3 sie 2026 · Advanced
Języki
1 sygnał dowodowy na tej stronie

SEO JavaScript jest o whether wyszukiwarki może crawlowanie, renderować, i indeks treść że depends na JavaScript. Google może uruchamiać JS — the awaria modes są więcej konkretny: parity (raw vs wyrenderowany), interaction (Google nie scroll lub click), state (the renderer jest stateless), i timing. Keep linki jako rzeczywisty anchors, Nie block JS/CSS, prefer SSR/prerendering dla treść że musi rank, i watch infinite scroll — a tall renderować viewport może uzyskać dwa strony zindeksowany jako jeden.

TL;DR — Google może uruchamiać twój JavaScript, więc “może Google czytać JS?” jest the błędny question. The awaria modes są parity (raw vs. wyrenderowany DOM), interaction (Google nie scroll lub click), state (the renderer jest stateless), i timing. Keep linki jako rzeczywisty <a href> anchors, Nie block JS/CSS, lazy-load na viewport nie interaction, zwracać rzeczywisty statuses dla klient-side 404s, i remember a raw noindex may prevent renderowanie przed JavaScript może remove do. Combine directives że przezły faktycznie processed, ale nie assume a universal raw/wyrenderowany winner. Watch infinite scroll zwłaszcza: a tall renderować viewport może trigger the loader i merge dwa URLs do jeden zindeksowany strona. Dla renderer internals i który renderowanie mode do pick, widzieć rendering.

Może Google czytać JavaScript? Tak — że’s nie the question

Google can run your JavaScript — the real risks are parity, interaction, state, and timing. Źródło: /technical-seo/javascript-seo/

Three stages run left to right: crawl, render, and index. The render stage branches into four failure modes: parity, where the rendered DOM may not match expectations; interaction, where content requires a scroll or click; state, where content relies on cookies or storage that the renderer clears; and timing, where content is deferred behind slow JavaScript.

© Patrick Stox LLC · CC BY 4.0 ·

Google processes JavaScript apps w trzy phases: “Google processes JavaScript web apps w trzy main phases: 1. Crawlowanie 2. Renderowanie 3. Indeksowanie.” The middle phase uruchamia twój JS w an evergreen, headless Chrome do build the DOM że otrzymuje zindeksowany. “Renderowanie jest ważny ponieważ websites często rely na JavaScript do bring treść do strona, i bez renderowanie Google might nie widzieć że treść.”

Evidence for this claim Google processes JavaScript web apps in three main phases: crawling, rendering, and indexing; without rendering, Google might not see JavaScript-provided content. Scope: Google Search's processing of JavaScript pages; successful rendering does not guarantee indexing or ranking. Confidence: high · Verified: Google Search Central: Understand the JavaScript SEO basics

Więc Google może uruchamiać twój JavaScript. The useful questions są więcej konkretny:

  • Parity — does the wyrenderowany DOM faktycznie contain co ty think do does?
  • Interaction — does anything require a scroll/click Google won’t perform?
  • State — są ty relying na cookies/localStorage the stateless renderer clears?
  • Timing — jest critical treść deferred behind slow lub late JavaScript?

Na timing specifically: Google queues a crawled strona (jeden że returned a 200) dla renderowanie, i “strona may stay na ten queue dla a few seconds, ale do może podejmować longer niż że.” There’s nie published fixed delay lub timeout — i strona że zwraca a non-200 status, lub że starts out z a noindex directive, może skip the renderować queue rather niż wait dla JavaScript do change do.

Evidence for this claim Google queues crawled pages with a 200 response for rendering; the page may stay in that queue for a few seconds but can take longer, with no published fixed delay or timeout, and non-200 or initial noindex responses may skip rendering. Scope: Google Search's documented render-queue behavior; not a guaranteed or universal timing figure. Confidence: high · Verified: Google Search Central: Understand the JavaScript SEO basics

The mechanics z jak Google renders — the Web Renderowanie Service, statelessness, caching, the “dwa waves” myth — działający na rendering strona. Here I’ll focus na practical problemy i fixes.

Linki musi przezć rzeczywisty <a href> anchors

Ten jest the single most wspólny JS-SEO bug. “Google może tylko odkrywać twój linki jeśli oni są <a> HTML elements z an href attribute.” A clickable <div> z an onclick handler jest invisible do Google jako a link — do won’t przezć followed, i strony że depend na do dla discovery może go uncrawled. Do’s perfectly fine do inject linki z JavaScript, jako long jako oni end up jako rzeczywisty <a href> anchors w wyrenderowany DOM. Te wyrenderowany anchors są parsed po JavaScript uruchamia, though — landing w wyrenderowany DOM sprawia a link discoverable, do’s nie a promise że the URL otrzymuje crawled, zindeksowany, lub treated do samo jako a link present w surowy HTML.

Evidence for this claim Google can reliably discover links only when they are HTML anchor elements with an href attribute. Scope: Link discovery by Google Search; this does not claim that every discovered URL will be crawled or indexed. Confidence: high · Verified: Google Search Central: Make your links crawlable

Lazy-loaded i interaction-gated treść

The renderer nie behave like a curious user: “Google Search nie interact z twoja strona.” Nie scrolling, nie clicking, nie hovering. Więc dowolny treść że tylko loads na jeden z te events won’t przezć seen.

Google’s guidance: load treść gdy do enters the viewport, nie gdy the user acts — “Upewnij się że twój lazy-loading implementation loads wszystkie relevant treść whenever do jest visible w viewport,” i “Nie add lazy-loading do treść że jest likely do przezć immediately visible gdy a user opens strona.” Używać IntersectionObserver lub native loading="lazy" dla images — never a scroll lub click handler — więc the treść loads podczas a normal renderować.

Evidence for this claim Google Search does not interact with a page, so lazy-loaded content should load when it becomes visible in the viewport rather than requiring user interaction. Scope: Google Search's documented rendering behavior for lazy-loaded content; other crawlers can behave differently. Confidence: high · Verified: Google Search Central: Fix lazy-loaded content

Infinite scroll: gdy dwa strony uzyskać zindeksowany jako jeden

Google's tall render viewport can trigger an infinite-scroll loader and merge two pages into one indexed URL. Źródło: /technical-seo/javascript-seo/

A normal browser viewport stops after the first page, but Google's render viewport expands much taller. The expansion reaches an infinite-scroll trigger, fires the loader without a real user scroll, and appends the next page into the same DOM. Google then indexes both pages' content under one URL.

© Patrick Stox LLC · CC BY 4.0 ·

Ten jest the jeden almost nobody explains, i do’s worth the whole section.

Googlebot może renderować w a viewport considerably taller niż a typical przeglądarka window. Google nie publish an dokładny renderować viewport size — i do może change — więc Nie design against a konkretny number; test twój own implementation zamiast. Co matters jest the mechanism: jeśli twój infinite-scroll loader fires based na scroll position lub viewport height, a taller-niż-expected renderowanie viewport może trigger the loader podczas renderowanie itself — i next article lub product strona’s treść otrzymuje appended do do samo DOM. Now dwa distinct URLs’ treść has been wyrenderowany together, i Google może indeks them jako jeden strona. W my own experience, “occasionally, dwa strony uzyskać zindeksowany jako jeden” — I’ve had strony reported jako “nie zindeksowany” że przezły faktycznie zindeksowany jako part z another strona (zwykle the previous post w feed), ponieważ “gdy Google resized the viewport do przezć longer … do triggered the infinite scroll i loaded another article w gdy do przezł renderowanie.” Confirm whether twój own setup does ten przez checking URL Inspection’s wyrenderowany HTML dla strona ty’d expect do stop short — Nie assume a size i Nie assume ty’re safe.

Są dwa layers do getting ten właściwy.

Sprawić infinite scroll search-friendly w pierwszy place. Support paginated loading underneath the infinite scroll. Każdy chunk należy have “jego own persistent, unique URL,” the treść na każdy URL należy stay do samo każdy time do loads, Należy avoid relative parameters like ?date=yesterday, Należy “link sequentially do the individual URLs więc że wyszukiwarki może odkrywać the URLs w a paginated set,” i gdy a nowy chunk loads na scroll Należy “update the displayed URL używając the History API.” Używać rzeczywisty <a href> pagination linki i unique URLs — “Nie używać URL fragment identifiers” (the part po a #) dla strona numbers, ponieważ Google ignores them. Jako I say w my JavaScript SEO guide, “jeśli ty have an infinite scroll setup, I nadal recommend a paginated strona version więc że Google nadal może crawlowanie properly.”

Jeśli a buggy loader jest actively merging strony, the fastest fix jest blunt: “block the JavaScript plik że handles the infinite scrolling więc the functionality może’t trigger.” Jeśli the loader może’t uruchamiać podczas renderować, do może’t append the next strona’s treść, i każdy URL renders jako itself again.

Soft-404s po klient-side routing

Single-strona apps może swap treść bez changing the HTTP status code, więc a “nie found” view nadal może zwracać 200. Google may classify że odpowiedź jako a soft 404 po evaluating the returned treść, ale a statyczny fetch alone nie może prove że Google has zrobiony że classification. Dwa fixes: navigate z History API, i dla a genuine nie-found state either route do a URL że zwraca a rzeczywisty 404 status lub add a noindex tag. I Nie lean na URL fragments dla routing — “the AJAX-crawlowanie scheme has been deprecated since 2015, więc Możesz’t rely na URL fragments do działać z Googlebot.”

A klient-side redirect musi samo evidence problem: the initial odpowiedź może remain 200 until JavaScript uruchamia. Google supports JavaScript redirects only as a fallback gdy serwer-side lub meta-refresh redirects są nie possible. Report the statyczny status i observed wyrenderowany navigation separately; nie rewrite the HTTP status w audit lub wywołanie każdy wyrenderowany URL change a redirect.

Nie block JavaScript lub CSS w robots.txt

Google won’t renderować JavaScript z blocked pliki lub na blocked strony. A robots.txt reguła że disallows twój bundle (lub /_next/, /static/, /assets/ directory do lives w) może break renderowanie entirely — Google fetches the shell, może’t uruchamiać the scripts, i indexes an empty strona. Check URL Inspection’s strona zasoby dla anything blocked.

DOM parity i stage-aware robots directives

Compare twój surowy HTML (View Źródło) against the wyrenderowany HTML (URL Inspection). Treść że tylko exists w wyrenderowany HTML nadal indexes — jeśli do renders. Treść w neither nie exist do Google.

There’s jeden stage-order ryzyko Google documents directly: “Gdy Google encounters the noindex tag, do may skip renderowanie i JavaScript execution, który means używając JavaScript do change lub remove the robots znacznik meta z noindex may nie działać jako expected.” Jeśli twój surowy HTML ships an initial noindex ty meant do swap out z JavaScript, Google może act na że raw noindex i never uruchamiać the script że przez have removed do.

Nie turn ten do a universal “wyrenderowany wins” reguła. Reconciliation jest field-konkretny:

FieldCo the raw/wyrenderowany comparison może establish
Main treść i linkiGoogle może używać treść i rzeczywisty <a href> linki produced podczas renderowanie jeśli renderowanie succeeds. Raw availability reduces że dependency.
Title i descriptionGoogle może process JavaScript-set metadata, ale title linki i snippets są selected z several źródła. Pokazywać both states; nie claim the wyrenderowany, pierwszy, lub ostatni value jest guaranteed.
Robots directivesA raw noindex may cause Google do skip renderowanie, więc JavaScript removal may never przezć seen. Adding restrictions later jest nie evidence że an earlier restriction przezł cancelled.
CanonicalGoogle’s JavaScript guidance says nie do set jeden value w źródło a następnie change do z JavaScript. Używać jeden method i verify jeden wyrenderowany-head declaration.
HTTP status i redirectJavaScript nie może change the odpowiedź status już received. Record the statyczny status i dowolny observed wyrenderowany navigation jako separate facts.

Że matrix jest dlaczego an auditor należy keep źródło, wyrenderowany, odpowiedź-nagłówek, i observed-search state distinct rather niż collapsing them do jeden “effective” value.

Pick a renderowanie mode że puts treść w DOM

Most JS-SEO ryzyko comes down do jak the HTML jest produced. The short version: SSR, statyczny/prerendering, i hydration wszystkie put treść w (lub quickly do) the DOM, który reduces jak much twój visibility depends na renderer succeeding; full klient-side renderowanie leaves więcej riding na renderowanie completing correctly, na time, każdy time. Dynamiczny renderowanie jest a workaround, nie a peer option — jako z Google’s guidance ostatni updated December 2025, do describes dynamiczny renderowanie jako a workaround rather niż a long-term solution i recommends renderowanie po stronie serwera, statyczny renderowanie, lub hydration zamiast. Jako I put do w my JavaScript SEO guide, “dowolny kind z SSR, statyczny renderowanie, i prerendering setup jest going do przezć fine dla wyszukiwarki.” The full menu — CSR, SSR, SSG, hydration, ISR, edge, streaming, i dynamiczny renderowanie — z a trade-off table jest na rendering strona. Google separately describes renderowanie po stronie serwera lub pre-renderowanie jako a dobry idea dla users i crawlery. Evidence for this claim Google describes server-side rendering or pre-rendering as a good idea because it makes a website faster for users and crawlers. Scope: Google Search guidance for JavaScript sites; the source does not prescribe one framework or guarantee indexing. Confidence: high · Verified: Google Search Central: Understand the JavaScript SEO basics

Jak test

URL Inspection w Search Console jest the źródło z truth: uruchamiać a działający test, wtedy wyglądać w the wyrenderowany HTML, the screenshot, i strona zasoby / console messages do widzieć co loaded i co failed. The Rich Results Test daje a quick wyrenderowany-HTML check. Na dużą skalę, używać a crawler że executes JavaScript (Ahrefs Witryna Audit, Screaming Frog w JS-renderowanie mode) do diff raw vs. wyrenderowany across witryna.

A render diff is diagnostic, not a score: investigate essential elements that appear only after JavaScript—or disappear after rendering.

An illustrative page has 1 title in both raw and rendered HTML, 18 headings in raw HTML and 19 rendered, 42 internal links in raw HTML and 71 rendered, 0 product descriptions in raw HTML and 12 rendered, and 6 canonical tags in raw HTML but only 1 rendered. These counts are synthetic.

JavaScript jest nie zły dla SEO, i do’s nie evil. Do’s just różny z co wiele SEOs są używany do. Działać z twój developers, uzyskać twój ważny treść do the DOM, i let Google’s own narzędzia — nie twój assumptions — przezć the arbiter z co wyrenderowany.

Gdzie do go next: the SEO JavaScript cluster

Ten hub jest mapą. Każdy z poniższych tematów to osobne pogłębione omówienie:

Renderowanie i architecture

  • SEO dla a headless CMS — jak decoupled frontends affect crawlowanie, renderowanie, metadata, sitemaps, i canonical tags; który renderowanie mode do pick; i headless-konkretny awaria modes ty trzeba know.

Framework-konkretny guides

  • React SEO — dlaczego CSR-pierwszy React tworzy indeksowanie ryzyko, jak Google renders React apps, React Router i History API, react-helmet-async dla meta tags, i gdy do reach dla Next.js.
  • Angular SEO — Angular’s SPA defaults, @angular/ssr (Angular Universal’s successor), the built-w Title i Meta services, prerendering, i incremental hydration w modern Angular.
  • Next.js SEO — Strony Router vs App Router, the Metadata API, next/image i CWV, ISR timing i Googlebot, sitemaps, i most wspólny Next.js SEO mistakes.
  • Nuxt SEO — SSR domyślnie, useSeoMeta(), Nuxt’s renderowanie modes, the @nuxtjs/seo module ecosystem, i jak Nuxt compares do zwykły Vue dla indexability.
  • Vue SEO — Vue 3’s CSR default i co że means dla crawlery, createWebHistory(), @unhead/vue, prerendering options bez a meta-framework, i gdy Nuxt jest the właściwy wywołanie.
  • Svelte SEO — Svelte vs SvelteKit, SSR domyślnie w SvelteKit, <svelte:head>, the adapter-static + ssr: false trap, adapter choices, i AI crawler implications.
  • Astro SEO — zero-JS domyślnie, islands architecture, @astrojs/sitemap, astro:assets, View Transitions i History API, Serwer Islands fallback behavior, i Astro’s Core Web Vitals advantages.

Add an expert note

Pin an expert quote

New person? Create their unclaimed profile at /admin/experts/ → Pin a quote first.