Free auditStart free
GuideSEO issue · Performance

Render-blocking JavaScript

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 withChatGPTClaudePerplexityGoogleAI Mode
01Checklist

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 or PageSpeed Insights finding is a lead; check the trace before changing load behavior. Lighthouse flags a script as 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.
First1
Check scripts near the top of <head> without async, defer, or type=module.
Next1
Separate first-party code from tag managers, chat widgets, experiments, and analytics. Remove scripts nobody uses before optimizing them.
Then1
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, 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.

03Checklist

Treat third-party scripts as product decisions

A 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.
First2
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.
Next1
For consent tools, test both consent states and the order in which tags fire.
Then1
For ecommerce, test search, filters, cart, and checkout. A faster landing paint is not a win if purchasing stops working.
04How 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. For slow server delivery before scripts start, see 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 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.

01Should 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.

02Does `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. 01PageSpeed Rules and Recommendationsweb.dev · checked 2026-10-24
  2. 02The script elementdeveloper.mozilla.org · checked 2026-10-24
  3. 03Eliminate render-blocking resources (Lighthouse)developer.chrome.com · checked 2026-10-24
Free · 2 minutes

Tools point. Agencies advise. This one ships.

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

Free, no card60 secondsNobody will call you
  • 46 fixes shipped without a ticket Brightpipe
  • 0→7 ChatGPT citations in six weeks Paylane