# Reduce render-blocking resources

- Check 06.12 · Performance and Core Web Vitals · Important
- Source: https://checklist-seo-geo.com/en/performance-core-web-vitals/reduce-render-blocking-resources
- Find the stylesheets and scripts that block the first render, then defer, split or inline them on WordPress, Shopify, Laravel or Next.js.
- Updated on 2026-11-25
- Licence: CC BY 4.0. Credit “Checklist SEO & GEO” with a link to https://checklist-seo-geo.com/en/performance-core-web-vitals/reduce-render-blocking-resources.
- Plugin checklist-seo-geo: 1.3.1 · https://github.com/maximegaul/checklist-seo-geo

## In short

A resource is render-blocking when the browser has to download and process it before displaying a single pixel: this applies to every stylesheet and every synchronous script in the `head`. The task is to cut this list down to the bare minimum: deferred scripts, lighter CSS, third-party files moved off the critical path. The goal is not zero blocking resources, but for the remaining ones to be few, light and served from your own domain.

## Why it matters

To display a page, the browser builds two structures: the DOM from the HTML and the CSSOM from the CSS. It refuses to paint until the CSS declared in the `head` has fully loaded, so as not to show an unstyled page.

Scripts make things worse. A `script` tag with neither a `defer` nor an `async` attribute stops HTML parsing: the browser downloads the file, runs it, then resumes. If the script follows a stylesheet, it also waits for that stylesheet to load.

Each blocking resource therefore pushes back FCP (First Contentful Paint, first render) and, behind it, LCP (Largest Contentful Paint, rendering of the largest visible element). The effect is greatest when the resource comes from another domain, since its name has to be resolved and a connection opened first, and on mobile networks, where each round trip is expensive.

## What it improves

- **FCP and LCP**: content appears sooner. It is the LCP “render delay” that shrinks.
- **Robustness**: a slow or broken third-party script no longer leaves the page blank.
- **Lighthouse audit**: the diagnostic on render-blocking requests empties.
- **INP (Interaction to Next Paint)**: indirect effect. Deferring a script does not remove its execution, it moves it.
- **Rankings**: no direct effect; a contribution to LCP.

## How to check

**Lighthouse and PageSpeed Insights** list the files involved in the diagnostic dedicated to render-blocking requests, with their size and duration.

**Browser console**, in Chrome or Edge:

```js
performance.getEntriesByType('resource')
  .filter((ressource) => ressource.renderBlockingStatus === 'blocking')
  .map((ressource) => ressource.name);
```

**Source code**: open the initial HTML and read the `head`. Every `link rel="stylesheet"` without a restrictive `media` attribute and every `script src` without `defer`, `async` or `type="module"` is blocking.

Compliant result: one or two stylesheets from your own domain, no synchronous script in the `head` unless justified, no third-party stylesheet.

## How to implement

### Before you start

Proceed in this order, from the least risky to the most delicate:

1. remove resources that are not used;
2. defer JavaScript;
3. slim down and split CSS;
4. as a last resort, inline critical CSS in the HTML.

With HTTP/2, a single stylesheet that is compressed and cached is not a problem. There is no need to go as far as step 4 if LCP is already good.

### Defer JavaScript

```html
<script src="/js/app.js" defer></script>
<script src="https://analytics.example.com/script.js" async></script>
<script type="module" src="/js/menu.js"></script>
```

| Attribute | Download | Execution | Use |
|---|---|---|---|
| none | Blocks HTML parsing | Immediate | Avoid in the `head` |
| `defer` | In parallel | After HTML parsing, in document order | Site scripts |
| `async` | In parallel | As soon as the file is ready, order not guaranteed | Independent scripts: analytics |
| `type="module"` | In parallel | Like `defer` | Modern code |

`defer` and `async` have no effect on an inline script without a `src` attribute. An inline script that depends on a deferred file must wait for the `DOMContentLoaded` event, or be moved into that file. Details in [defer non-essential scripts](https://checklist-seo-geo.com/en/performance-core-web-vitals/defer-non-essential-scripts).

### Slim down and split CSS

- Remove unused rules and minify: [remove unused CSS/JS](https://checklist-seo-geo.com/en/performance-core-web-vitals/remove-unused-css-js), [minify CSS and JavaScript](https://checklist-seo-geo.com/en/performance-core-web-vitals/minify-css-javascript).
- Replace `@import` statements in CSS files with `link` tags or with concatenation at build time: an `@import` is only discovered after the file containing it has been downloaded.
- Move context-specific styles off the critical path with the `media` attribute:

```html
<link rel="stylesheet" href="/css/app.css">
<link rel="stylesheet" href="/css/impression.css" media="print">
<link rel="stylesheet" href="/css/grand-ecran.css" media="(min-width: 1024px)">
```

A stylesheet whose media query does not match the screen is downloaded at low priority and does not block rendering.

### Inline critical CSS

The principle: put the rules needed for the part visible without scrolling into a `style` tag in the `head`, and load the rest without blocking.

```html
<style>
  /* Critical CSS generated by the tool */
</style>
<link rel="preload" href="/css/app.css" as="style" onload="this.onload=null;this.rel='stylesheet'">
<noscript><link rel="stylesheet" href="/css/app.css"></noscript>
```

Generate critical CSS with a tool rather than by hand, per template:

```bash
npx critical dist/index.html --base dist/ --inline --width 412 --height 915 > dist/index.critique.html
```

> **Warning:** this technique has a cost. Inlined CSS is not cached by the browser and weighs down every page; incomplete critical CSS causes an unstyled render followed by a layout shift. Regenerate it with every design change and check [CLS](https://checklist-seo-geo.com/en/performance-core-web-vitals/target-cls-01-at-75th-percentile).

### Handle fonts and third-party stylesheets

A stylesheet loaded from another domain (hosted fonts, icon library, widget) blocks rendering and requires an extra connection. Host these files on your own domain: [optimize fonts](https://checklist-seo-geo.com/en/performance-core-web-vitals/optimize-fonts-woff2-font-display). If a third-party domain remains essential right from the start of loading, open the connection in advance:

```html
<link rel="preconnect" href="https://fonts.gstatic.com" crossorigin>
```

### Handle marketing tags and A/B tests

A/B testing tools often recommend a synchronous script at the top of the page, sometimes along with a snippet that hides the page while it initializes. This is the most expensive blocking resource there is: limit it to the pages actually being tested, reduce its maximum timeout and remove it when the test ends. Load the tag manager with `async`. See [limit third-party scripts](https://checklist-seo-geo.com/en/performance-core-web-vitals/limit-third-party-scripts).

### Cloudflare

Versions: Cloudflare dashboard, all plans, November 2026.

Rocket Loader, in the [speed optimization settings](https://dash.cloudflare.com/?to=/:account/:zone/speed/optimization) (`Speed > Settings > Content Optimization`), automatically defers every script on the page. The gain is real, but so is the risk: inline scripts run in the wrong order, widgets that no longer initialize. Test on each template and exclude a script by adding the `data-cfasync="false"` attribute to it. Prefer a controlled `defer` in your templates when you have access to the code.

### WordPress

Versions: WordPress 6.3 and later (up to 7.1).

Since WordPress 6.3, the loading strategy is declared when the script is registered:

```php
add_action('wp_enqueue_scripts', function (): void {
    wp_enqueue_script(
        'theme-app',
        get_theme_file_uri('assets/js/app.js'),
        [],
        '1.4.0',
        ['strategy' => 'defer', 'in_footer' => false]
    );
});
```

WordPress checks dependencies: if a dependent script cannot itself be deferred, the strategy is ignored so that nothing breaks.

Without code, through an optimization plugin:

- **WP Rocket**: `File Optimization`, deferred JavaScript loading and CSS delivery optimization;
- **Autoptimize**: options to defer JavaScript and inline critical CSS;
- **LiteSpeed Cache**: `Page Optimization`, asynchronous CSS loading and deferred JavaScript;
- **Perfmatters**: deferred JavaScript with an exclusion list.

Enable one option at a time. The classic trap: an inline script that calls jQuery when jQuery has just been deferred. Exclude jQuery from deferral, or fix the offending script.

### Shopify

Versions: Online Store 2.0 themes (Liquid), November 2026.

In `theme.liquid`, the `script_tag` filter produces a blocking tag. Write the tag yourself:

```liquid
<script src="{{ 'theme.js' | asset_url }}" defer></script>
```

Load a section's own CSS in the section, not in the global `head`. Scripts injected by apps are partly beyond your control: uninstall the ones you do not use and check what they add to the `head`.

### PrestaShop

Versions: PrestaShop 8 and 9.

In a module, register scripts at the bottom of the page with a defer attribute:

```php
$this->context->controller->registerJavascript(
    'module-exemple',
    'modules/exemple/views/js/exemple.js',
    ['position' => 'bottom', 'priority' => 200, 'attributes' => 'defer']
);
```

In a theme, the same declaration goes in `theme.yml`. The CCC options in `Advanced Parameters > Performance` combine files, which reduces the number of blocking requests.

### Laravel

Versions: Laravel 11 to 13.

The `@vite` directive generates `script type="module"` tags, deferred by nature, and `link` tags for CSS. Nothing to add for JavaScript. For scripts added by hand, place a `@stack('scripts')` before the closing `body` tag and use `defer`. Keep a single CSS entry point per template to limit blocking stylesheets.

### Next.js

Versions: Next.js 15 and 16 (App Router).

Next.js loads its own scripts without blocking rendering and splits CSS by route. What remains are third-party scripts, to be declared with `next/script`:

```js
import Script from 'next/script';

export default function RootLayout({ children }) {
  return (
    <html lang="fr">
      <body>
        {children}
        <Script src="https://widget.example.com/chat.js" strategy="lazyOnload" />
      </body>
    </html>
  );
}
```

The default strategy, `afterInteractive`, suits analytics tools; reserve `beforeInteractive` for the very rare scripts that must run before hydration. `next/font` hosts fonts on your own domain and removes the third-party stylesheet.

## Common mistakes

- **Putting `async` on scripts that depend on each other**: execution order is no longer guaranteed and errors appear at random.
- **Deferring all CSS**: the page displays unstyled, then jumps. The CSS for the visible part must remain blocking or be inlined.
- **Moving stylesheets to the bottom of the `body`**: same effect, with a layout shift thrown in.
- **Generating critical CSS once and for all**: it becomes wrong at the first template change.
- **Preloading to compensate**: a `preload` does not make a resource non-blocking, it only makes it start earlier. See [preload only critical resources](https://checklist-seo-geo.com/en/performance-core-web-vitals/preload-only-critical-resources).
- **Believing a script at the bottom of the page costs nothing**: it no longer blocks the first render, but it still runs on the main thread.
- **Leaving an A/B testing tool's page-hiding snippet** in place when no test is running.
- **Aiming for zero blocking resources** at the cost of an unstable site: a light, well-cached stylesheet is a good compromise.

## Frequently asked questions

### What is a render-blocking resource?

It is a file the browser has to download and process before displaying a single pixel: any stylesheet declared in the head without a restrictive media attribute, and any script in the head without defer, async or type="module". Each one pushes back the first render, then LCP, all the more so if it comes from another domain or if the visitor is browsing on a mobile network.

### Should I eliminate every render-blocking resource?

No. The goal is for the remaining ones to be few, light and served from your own domain. With HTTP/2, a single stylesheet that is compressed and cached is not a problem. Deferring all the CSS would make the page appear unstyled, then jump. Only go as far as inlining critical CSS in the HTML if LCP remains poor.

### Should I inline critical CSS in the HTML?

Only as a last resort, when LCP remains poor after deferring JavaScript and slimming down CSS. The technique has a cost: inlined CSS is not cached and weighs down every page, and incomplete critical CSS causes an unstyled render followed by a layout shift. Generate it with a tool, per template, and regenerate it with every design change.

### Does preload make a resource non-blocking?

No. A preload only makes a resource's download start earlier; it does not change whether it is blocking. A stylesheet loaded normally in the head still blocks rendering, preloaded or not. To move a resource off the critical path, defer the script with defer or async, restrict the stylesheet with the media attribute, or remove it if it is not used.

## Resources

- [Chrome for Developers: Eliminate render-blocking resources](https://developer.chrome.com/docs/lighthouse/performance/render-blocking-resources)
- [web.dev: Defer non-critical CSS](https://web.dev/articles/defer-non-critical-css)
- [web.dev: Extract critical CSS](https://web.dev/articles/extract-critical-css)
- [MDN: The script element, async and defer attributes](https://developer.mozilla.org/en-US/docs/Web/HTML/Reference/Elements/script)
- [MDN: renderBlockingStatus](https://developer.mozilla.org/en-US/docs/Web/API/PerformanceResourceTiming/renderBlockingStatus)
- [WordPress: Script loading strategies](https://make.wordpress.org/core/2023/07/14/registering-scripts-with-async-and-defer-attributes-in-wordpress-6-3/)
- [Cloudflare: Rocket Loader](https://developers.cloudflare.com/speed/optimization/content/rocket-loader/)
- [Next.js: Script component](https://nextjs.org/docs/app/api-reference/components/script)
- [critical tool on GitHub](https://github.com/addyosmani/critical)

Next steps: [defer non-essential scripts](https://checklist-seo-geo.com/en/performance-core-web-vitals/defer-non-essential-scripts), [remove unused CSS and JavaScript](https://checklist-seo-geo.com/en/performance-core-web-vitals/remove-unused-css-js) and [optimize fonts (WOFF2, font-display)](https://checklist-seo-geo.com/en/performance-core-web-vitals/optimize-fonts-woff2-font-display).
