SEO & Speed Optimization

Eliminate Render-Blocking Resources: Critical CSS, Defer and Async Explained

Render-blocking CSS and JavaScript delay the first paint of your page. Here's how to fix this common PageSpeed warning safely.

In this article · 6 sections
  1. Render-blocking JavaScript
  2. Render-blocking CSS
  3. 1. Inline critical CSS
  4. 2. Remove unused CSS
  5. 3. Media attributes
  6. 4. Fewer, smaller files
  7. Fonts
  8. WordPress
  9. Be careful
  10. FAQs
  11. Can I remove all render-blocking resources?
  12. Does this affect SEO?

When a browser loads your page, CSS and some JavaScript in the <head> must be downloaded and processed before anything appears on screen. These are render-blocking resources. Learning to eliminate render-blocking resources (or minimise them) speeds up First Contentful Paint and LCP.

Render-blocking JavaScript

Scripts in the head without defer or async stop HTML parsing.

<!-- Blocking -->
<script src="/js/app.js"></script>

<!-- Better -->
<script src="/js/app.js" defer></script>
<script src="https://example-analytics.com/tag.js" async></script>
  • defer: downloads in parallel, runs after HTML is parsed, in order. Best for most site scripts
  • async: downloads in parallel, runs as soon as ready, in any order. Good for independent scripts like analytics
  • Move non-critical scripts to load after interaction. See reduce unused JavaScript

Render-blocking CSS

CSS is render-blocking by design (to avoid unstyled content). Reduce its impact:

1. Inline critical CSS

Put the small amount of CSS needed for the first screen (header, hero) directly in a <style> tag in the head. Load the rest without blocking:

<link rel="preload" href="/css/main.css" as="style" onload="this.onload=null;this.rel='stylesheet'">
<noscript><link rel="stylesheet" href="/css/main.css"></noscript>

2. Remove unused CSS

Large frameworks and page builders load lots of unused CSS. Purge it where possible. See Tailwind vs Bootstrap.

3. Media attributes

Stylesheets for print or specific screen sizes:

<link rel="stylesheet" href="/css/print.css" media="print">

4. Fewer, smaller files

Combine tiny CSS files carefully; minify.

Fonts

Web fonts can delay text rendering. Self-host, preload the main font and use font-display: swap. See web fonts and speed.

WordPress

Caching/optimisation plugins offer "defer JavaScript", "delay JavaScript", "generate critical CSS" and "remove unused CSS". Enable one at a time and test pages (menus, forms, sliders, checkout) after each change.

Be careful

  • Deferring jQuery while inline scripts depend on it causes errors
  • Delaying scripts can break above-the-fold features like mobile menus
  • Always test on a staging site

FAQs

Can I remove all render-blocking resources?

Some CSS will always be needed before first paint. The goal is to make it small and fast.

Does this affect SEO?

Faster rendering improves user experience and Core Web Vitals, which support SEO.

Joboo Web fine-tunes CSS and JavaScript loading on every site we optimise. Get a speed audit.

Share this article

Joboo Web

Web design, SEO & digital marketing team · Ludhiana, Punjab

Joboo Web has helped Indian businesses grow online since 2019 — building fast websites and running SEO, Google Ads and social campaigns for clients in 80+ cities. About us →

Keep reading

💬