# Render-blocking JavaScript

> Find scripts that delay first render, choose async or defer based on dependencies, and verify the change without breaking page behavior.

Canonical: https://scaplet.com/seo-issues/render-blocking-javascript

Guide SEO issue · Performance

Find scripts that delay first render, choose async or defer based on dependencies, and verify the change without breaking page behavior.

4 min

read

3

sources

Oct 24, 2026

updated

Scaplet Editorial Team

author

In one line

A classic script without `async`, `defer`, or `type=module` pauses HTML parsing while it loads and runs. Move nonessential scripts out of that path: use `defer` when execution order matters, and `async` only when a script is independent. Confirm the browser still renders the main content and that dependent scripts run in the right order.

30-second check

## Where does your site stand?

Four quick questions, then a straight answer.

1/4Have you checked your own site for this?

Summarize this page with [ChatGPT](https://chatgpt.com/?hints=search&q=Summarize%20https%3A%2F%2Fscaplet.com%2Fseo-issues%2Frender-blocking-javascript%20(%22Render-blocking%20JavaScript%22)%20in%205%20bullet%20points%2C%20then%20tell%20me%20the%20one%20thing%20I%20should%20do%20next.) [Claude](https://claude.ai/new?q=Summarize%20https%3A%2F%2Fscaplet.com%2Fseo-issues%2Frender-blocking-javascript%20(%22Render-blocking%20JavaScript%22)%20in%205%20bullet%20points%2C%20then%20tell%20me%20the%20one%20thing%20I%20should%20do%20next.) [Perplexity](https://www.perplexity.ai/search?q=Summarize%20https%3A%2F%2Fscaplet.com%2Fseo-issues%2Frender-blocking-javascript%20(%22Render-blocking%20JavaScript%22)%20in%205%20bullet%20points%2C%20then%20tell%20me%20the%20one%20thing%20I%20should%20do%20next.) [![Google](/logos/ai/google-color.svg)AI Mode](https://www.google.com/search?udm=50&q=Summarize%20https%3A%2F%2Fscaplet.com%2Fseo-issues%2Frender-blocking-javascript%20(%22Render-blocking%20JavaScript%22)%20in%205%20bullet%20points%2C%20then%20tell%20me%20the%20one%20thing%20I%20should%20do%20next.)

On this page

## 4 parts, 4 minutes.

1. [Find the script that holds up the page 01](#find-the-script-that-holds-up-the-page)
2. [Choose `defer` or `async` by dependency 02](#choose-defer-or-async-by-dependency)
3. [Treat third-party scripts as product decisions 03](#treat-third-party-scripts-as-product-decisions)
4. [Verify the change on real page behavior 04](#verify-the-change-on-real-page-behavior)

_01_Checklist

## Find the script that holds up the page

Start with a representative slow page, not every script in your bundle. In Chrome DevTools, open Network, disable cache, reload, and inspect the early requests. In Performance, record a trace and look for script downloads or execution before the first useful paint. A [Lighthouse](/glossary/lighthouse) or [PageSpeed Insights](/glossary/pagespeed-insights) finding is a lead; check the trace before changing load behavior. Lighthouse flags a script as [render-blocking](/glossary/render-blocking) when it sits in the `<head>` and has neither `defer` nor `async`. As of Lighthouse 13 that audit moved into the Render-blocking requests insight.

First_1_
Check scripts near the top of `<head>` without `async`, `defer`, or `type=module`.

Next_1_
Separate first-party code from tag managers, chat widgets, experiments, and analytics. Remove scripts nobody uses before optimizing them.

Then_1_
Inspect the dependency chain. A small loader can block the page while it synchronously pulls in a much larger script.

MDN separates the two: scripts are not render-blocking by default. A script without `type="module"`, `async`, or `defer` blocks parsing, not [rendering](/glossary/rendering), and only scripts in the document `<head>` can block rendering. Web.dev's guidance is that blocking the parser can still delay first render, because the browser must wait for the CSSOM before running the script. Fix the parser-blocking behavior when the trace shows it delays content users need.

_02_Keep scripts out of the parser's way without changing their contract

## Choose `defer` or `async` by dependency

Script behavior

### Needs the parsed document or must preserve order

Use

`defer` for an external classic script; deferred scripts run in document order after parsing.

What to verify

The script still runs before code that expects it, and page controls work.

Script behavior

### Independent of other scripts and order does not matter

Use

`async`; it downloads in parallel and executes as soon as it is ready.

What to verify

No other script or inline code assumes it has already run.

Script behavior

### Module script

Use

`type=module`; module scripts defer by default.

What to verify

Imports resolve and the page does not also add redundant classic-script behavior.

Script behavior

### Required to produce visible content immediately

Use

Keep only the minimum required code on the critical path; split or progressively initialize the rest.

What to verify

The content still appears when JavaScript is delayed or fails.

**`async` can break script order**Two async scripts run when each download finishes, not in the order they appear. If one depends on another, use `defer` or fix the dependency explicitly. Adding both `async` and `defer` behaves like `async`. `defer` and `async` need a `src`: MDN says they have no effect on inline classic scripts.

Ordered, noncritical scripts

```
<script defer src="/assets/vendor.js"></script> <script defer src="/assets/app.js"></script>
```

_03_Checklist

## Treat third-party scripts as product decisions

A [tag manager](/glossary/google-tag-manager) can hide the script that matters. Audit the tags it injects, remove duplicate or retired tags, and load optional widgets after the first interaction or when their section becomes relevant. Keep consent and security requirements intact; do not delay a script if doing so breaks a required user or legal flow.

First_2_
For analytics that only records page views, check whether a delayed load preserves the events you need.

For chat and support tools, load on intent if the initial page does not need the widget.

Next_1_
For consent tools, test both consent states and the order in which tags fire.

Then_1_
For ecommerce, test search, filters, cart, and checkout. A faster landing paint is not a win if purchasing stops working.

_04_How it works

## Verify the change on real page behavior

If the main delay is an oversized bundle rather than parser blocking, see the [JavaScript SEO guide](/glossary/javascript-seo). For slow server delivery before scripts start, see [slow TTFB](/seo-issues/slow-ttfb).

1. 01

### Capture a baseline

Record the affected URL, device profile, first useful content, script request waterfall, and any relevant [Core Web Vitals](/glossary/core-web-vitals) field data.
2. 02

### Change one loading strategy

Add `defer` or `async` only after checking dependencies. Avoid changing several vendors and application bundles at once.
3. 03

### Retest the same journey

Repeat the trace and exercise menus, forms, navigation, analytics consent, and any conversion action the script supports.
4. 04

### Compare field results

Use PageSpeed Insights or Search Console's Core Web Vitals report to see whether real-user performance improves. Lab traces help explain a change; they do not guarantee a ranking change.

Questions

## Asked a lot.

2 questions people ask next, answered from the sources on this page.

_01_ Should I add `async` to every script?

No. Use it only for scripts that do not depend on other scripts or a particular execution order. Use `defer` when order matters.

_02_ Does `defer` fix all JavaScript performance problems?

No. It avoids parser blocking for external classic scripts, but a large or long-running script can still delay interactions after it executes. Measure the page and consider reducing or splitting code.

Sources · 3

## Every fact, linked and dated.

Official docs first. The date is when we last opened each page.

- web.dev
- mozilla.org
- chrome.com

1. 01 [PageSpeed Rules and Recommendations](https://web.dev/articles/critical-rendering-path/page-speed-rules-and-recommendations) web.dev · checked 2026-10-24
2. 02 [The script element](https://developer.mozilla.org/en-US/docs/Web/HTML/Reference/Elements/script) developer.mozilla.org · checked 2026-10-24
3. 03 [Eliminate render-blocking resources (Lighthouse)](https://developer.chrome.com/docs/lighthouse/performance/render-blocking-resources) developer.chrome.com · checked 2026-10-24

## Keep learning

[All seo issues](/seo-issues)

[Learn Poor Largest Contentful Paint (LCP) Performance](/seo-issues/poor-lcp) [Related JavaScript SEO Crawling and indexing](/glossary/javascript-seo) [Read next Slow Time to First Byte Performance](/seo-issues/slow-ttfb) [Do Run a free site audit Free, about two minutes](/site-audit)

Nearby in SEO issues
[Redirect loops](/seo-issues/redirect-loops) [Redirects to a 404](/seo-issues/redirect-to-404) [Robots.txt blocks CSS or JavaScript](/seo-issues/robots-txt-blocks-css-js) [robots.txt not found](/seo-issues/robots-txt-not-found)

More in Performance
[Images without width and height](/seo-issues/images-without-dimensions) [LCP image is lazy-loaded](/seo-issues/lazy-loaded-lcp-image) [Poor Cumulative Layout Shift (CLS)](/seo-issues/poor-cls) [Poor Interaction to Next Paint (INP)](/seo-issues/poor-inp) [Poor Largest Contentful Paint (LCP)](/seo-issues/poor-lcp) [Render-blocking JavaScript](/seo-issues/render-blocking-javascript) [Slow Time to First Byte](/seo-issues/slow-ttfb) [Third-party scripts slowing your site](/seo-issues/third-party-scripts) [Web fonts are delaying text](/seo-issues/web-fonts-blocking-text)

Terms on this page
[Lighthouse](/glossary/lighthouse) [PageSpeed Insights](/glossary/pagespeed-insights) [Render-blocking](/glossary/render-blocking) [Rendering](/glossary/rendering) [Google Tag Manager](/glossary/google-tag-manager) [Core Web Vitals](/glossary/core-web-vitals) [JavaScript SEO](/glossary/javascript-seo)

Free · 2 minutes

## Tools point. Agencies advise. _This one ships._

Run the free audit, then approve the fixes. Every change can be undone.

[Audit my site free](/site-audit)

Free, no card 60 seconds Nobody will call you

- **46** fixes shipped without a ticket Brightpipe
- **0→7** ChatGPT citations in six weeks Paylane
