Storefront Speed Journal

Reviewed November 14, 2026

Render-Blocking JavaScript on Shopify: The Two Fixes That Matter

Render-blocking JavaScript is any script the browser must download, parse, and run before it can paint the page, and on Shopify it almost always comes from apps and tracking tags, not from the theme. The two fixes that matter are deferring or async-loading every script that does not need to run before the page appears, and removing the scripts that do nothing at all, which usually means removing the app that put them there. Measure first with PageSpeed Insights, fix the biggest blocker, and re-measure, because the worst script is usually not the one you expect.

Open PageSpeed Insights, run your homepage, and look at the opportunities list. Near the top, usually, is "Eliminate render-blocking resources." The browser found JavaScript files it has to download and run before it can show anything, and it is waiting on them. The page is not slow because the server is slow. It is slow because the browser is standing in line.

On Shopify, the line is almost always apps and tracking tags. Each app that touches the storefront adds its own JavaScript, and each tag adds another. The theme contributes too, but the theme is one file. The apps are ten files, each with its own download, each blocking the paint. The fix is not a new theme. It is fewer scripts, loaded later.

What render-blocking actually means

When a browser loads a page, it reads the HTML top to bottom. When it hits a script tag without async or defer, it stops, downloads the script, runs it, and only then continues reading the page. That stop is render-blocking: nothing appears on screen until the script finishes. One small script is a small stop. Ten app scripts, each 50 to 200 kilobytes, are a traffic jam, and on a phone on a 4G connection, the jam lasts seconds.

The scripts that block are not always the scripts you think. A chat widget that loads on every page, a reviews widget that fetches data before the page paints, a tracking pixel that fires synchronously, a currency converter that rewrites prices before the page shows. Each one is small. Together they are the reason your Largest Contentful Paint is 4 seconds instead of 2. PageSpeed Insights lists them in order of impact, and the list is the audit.

The two fixes

Fix one is defer or async. A script with the defer attribute downloads in parallel and runs after the page parses. A script with async downloads in parallel and runs as soon as it arrives, which is better than blocking but still interrupts the page. Most app scripts and tracking tags can be deferred without breaking anything, because they do not need to run before the page appears. The chat widget can wait half a second. The reviews widget can wait. The tracking pixel can wait. The only scripts that must run early are the ones that change what the page looks like, and there are very few of those.

Fix two is removal. An app you uninstalled often leaves its script behind, pasted into theme.liquid or loaded as a script tag that keeps running. Search theme.liquid and the snippets folder for the names of apps you no longer have, and remove what you find. Then audit the apps you do have: for each one, ask whether it touches the storefront, and whether it earns its weight. A reviews widget, a popup, an upsell tool, a currency converter, a wishlist, and a chat bubble can each add JavaScript to every page, including pages where they do nothing. Remove the ones that do not earn it.

Measure, fix, measure

Run PageSpeed Insights on your homepage, a busy collection page, and your best-selling product page, on mobile, before you change anything. Write down the Largest Contentful Paint and the list of render-blocking resources. Then defer the scripts, remove the dead ones, and run the same three pages again. The number that matters is LCP, not the lab score, and the target is 2.5 seconds or less for 75 percent of real visits.

If LCP is still over 2.5 seconds after the scripts are fixed, the problem is elsewhere, usually the hero image, which is the LCP element on most homepages. Fix the image next: serve the right size, never lazy-load it, mark it fetchpriority high. But fix the scripts first, because they are the most common cause, and because a page that paints fast with a slow image still feels faster than a page that paints late with a fast image.

Related reading

For the background behind “Render-Blocking JavaScript on Shopify: The Two Fixes That Matter”, these earlier guides help: Your Product Images Are 56 Times Too Big: Sizing Rules That Move LCP, Video Hero LCP: The Poster-Image Facade That Cut 9 Seconds to 2.7, and Lazy Loading Below the Fold: Where It Helps LCP and Where It Hurts.

Frequently asked questions

What is render-blocking JavaScript?

Any script the browser must download and run before it can show the page. When the browser hits a script tag without async or defer, it stops parsing, downloads the script, runs it, and only then continues. That stop delays everything the visitor sees.

How do I find render-blocking scripts on my store?

Run your homepage, a collection page, and a product page through PageSpeed Insights on mobile. The opportunities list names the render-blocking resources in order of impact. That list is your audit.

Should I defer or async my scripts?

Defer is usually better for app and tracking scripts, because it downloads in parallel and runs after the page parses. Async runs as soon as it arrives, which still interrupts the page. Either is better than blocking.

Do uninstalled apps leave JavaScript behind?

Often, yes. Older apps paste snippets into theme.liquid or create script tags that keep loading after uninstall. Search theme.liquid and the snippets folder for the names of apps you no longer have, and remove what you find.