Plugins Plugin hub Backup SEO Caching Security Forms WooCommerce Images Best backup plugins
Hosting Hosting directory Shared Managed Cloud India
Themes & builders Compare Rank Math vs Yoast
Tools All tools Hosting finder Plugin stack builder Cost calculator Salt generator Theme detector Who is hosting this? Speed test Headline analyzer robots.txt generator Redirect generator Uptime calculator Blog name generator
Best lists Best backup plugins Deals
Guides All guides Speed up WordPress Choose hosting Back up WordPress
How we test

Speed & performance · Guide

How to Eliminate Render-Blocking Resources in WordPress

Short answer

To eliminate render-blocking resources in WordPress, find the flagged CSS and JavaScript files in Lighthouse, defer non-critical scripts, inline critical CSS, load the rest of the CSS asynchronously, and remove unused code. Turn on one change at a time, clear the cache, and test menus, forms, and sliders after each change.

Key takeaways

  • Lighthouse flags scripts in the head without defer or async, and stylesheets without a disabled or non-matching media attribute.
  • WordPress 6.3 added a native strategy option to wp_enqueue_script() for defer and async loading.
  • Critical CSS is the small set of styles for the first screen, inlined in the head while the rest loads later.
  • LiteSpeed Cache offers Deferred JavaScript, which runs after HTML loads, and Delayed JavaScript, which waits for user activity.
  • WP Rocket offers Remove Unused CSS, Load JavaScript deferred, and Delay JavaScript execution in File Optimization.
  • Test every change on mobile and desktop, and check menus, forms, sliders, and checkout before you finish.

What is a render-blocking file in WordPress?

A render-blocking resource is a CSS or JavaScript file the browser must download and process before it can show your page content.

CSS is render-blocking by default because the browser builds the CSS Object Model before it paints, as web.dev explains in its guide to the critical rendering path.

JavaScript in the head without async or defer is parser-blocking, which also stops rendering, because the browser must run the script before it can parse the rest of the page.

In WordPress, these files usually come from your theme, plugins, fonts, and third-party tools such as analytics, chat widgets, and social embeds.

How do you find render-blocking files on your site?

Run PageSpeed Insights or Lighthouse on your slowest, most visited page, then open the “Render-blocking requests” insight in the report.

Chrome for Developers says Lighthouse flags a script tag in the head that has no defer attribute and no async attribute, as shown in its render-blocking resources page.

The same page says Lighthouse flags a stylesheet link tag that has no disabled attribute and no media attribute that matches the visitor device, and it notes that media="all" counts as render-blocking.

As of November 2026, Lighthouse 13 replaces the older render-blocking-resources audit with the render-blocking-insight, according to Chrome for Developers.

Use the Coverage tab in Chrome DevTools to see which CSS and JavaScript is unused on that page, because unused code should be removed before you defer the rest.

Test the same page 2 or 3 times, since Lighthouse results vary between runs, and record the file names and the time saved for each flagged file.

How do you defer JavaScript in WordPress?

Defer JavaScript that does not need to run before the page appears, and keep scripts that build the visible page or depend on order in their normal place.

The defer attribute lets the browser download a script in the background and run it after parsing has finished, while async runs a script as soon as it finishes downloading, as web.dev explains in its third-party JavaScript guide.

WordPress 6.3 added a native way to request either strategy, according to WordPress Developer Resources.

In your theme or plugin, pass an $args array to wp_enqueue_script() with 'strategy' => 'defer' and 'in_footer' => true, inside a function hooked to wp_enqueue_scripts.

Use defer for scripts that touch the page or depend on another script, and use async only for independent scripts such as analytics that do not depend on page order.

Steps to defer a theme script

  1. Back up your site and note the script handle you want to change.
  2. Open your child theme functions.php file, or the plugin file that enqueues the script.
  3. Find the wp_enqueue_script() call for that handle.
  4. Change its last argument to array( 'strategy' => 'defer', 'in_footer' => true ).
  5. Save the file, clear the cache, and load the page in a private browser window.
  6. Click menus, forms, sliders, and buttons to confirm each one still works.

If a script breaks, remove defer from that handle only, and add it to an exclusion list in your caching plugin instead of turning the whole feature off.

How do you fix render-blocking CSS?

Inline the small set of styles needed for the first screen, then load the rest of the CSS after the first paint.

Web.dev says the browser must download and parse CSS files before it can show the page, which makes CSS a render-blocking resource, in its extract critical CSS guide.

That guide also says inlining extracted styles in the head removes the extra request to fetch those styles, and the rest of the CSS can be loaded asynchronously.

Do not use CSS @import to load another stylesheet, because the browser must download the first file before it can start the second one.

Instead, load each stylesheet with its own stylesheet link tag, or let your caching plugin combine and load them in the order the theme needs.

CSS problemFix to use firstRisk if you get it wrong
Large theme stylesheetRemove unused CSS, then load the rest asynchronouslyUnstyled page flash or missing styles
Print stylesheet loaded for screensSet media="print" on that linkNone for screen visitors
Small critical styles in a big fileInline critical CSS in the headLarger HTML if you inline too much
CSS loaded with @importReplace it with a direct stylesheet link tagSlower first paint

For print styles, a media attribute that does not match the current device stops the file from blocking the first paint, as web.dev notes in its critical path guide.

What is critical CSS and how do you use it?

Critical CSS is the small set of styles needed to display the content in the first screen, also called above-the-fold content.

WP Rocket describes critical CSS as the CSS above the fold needed to display the page as quickly as possible, in its critical CSS guide.

The same guide lists 3 steps: find and generate the critical CSS, inline it in the head, and load the rest of the CSS asynchronously.

Web.dev suggests aiming to keep above-the-fold content under 14 KB compressed, to limit round trips before the first render, as noted in its extract critical CSS guide.

Generate critical CSS with your caching plugin, not by hand, because the styles differ by page type, device, and layout.

After you turn the feature on, check the home page, a post, a product page, and a mobile view, and look for missing fonts, wrong spacing, or a flash of unstyled content.

If a page looks wrong, add the missing class or file to the plugin safelist, regenerate the CSS, and clear the cache before you test again.

How do you remove unused CSS and JavaScript?

Remove code your pages never use, because code that never loads cannot block rendering.

Web.dev says the browser needs to download and parse all style sheets before rendering content, and removing unused CSS also cuts the work of building the render tree, in its resource loading guide.

Start in the Coverage tab, then remove or stop loading the worst files first, such as a slider library on pages with no slider.

In WP Rocket, go to “Settings > WP Rocket”, open the “File Optimization” tab, and turn on “Optimize CSS delivery” with “Remove Unused CSS”, as described in the WP Rocket best settings guide.

The same WP Rocket guide lists “Load JavaScript deferred” and “Delay JavaScript execution” as additional optimizations to turn on in the “File Optimization” tab.

In LiteSpeed Cache, go to “LiteSpeed Cache > Page Optimization”, open the “CSS Settings” tab, and use “Generate UCSS” with “CSS Combine” to keep only the CSS a page needs, as LiteSpeed documents.

LiteSpeed also offers “Load CSS Asynchronously”, which loads CSS and HTML at the same time and adds inline critical CSS to stop the page from appearing unformatted.

Never remove CSS or JavaScript by deleting plugin files by hand, because an update will restore them and your change will vanish.

How do you handle render-blocking files from plugins and themes?

Load each plugin file only on the pages that need it, and replace a heavy plugin when a lighter option does the same job.

Many WordPress sites load a contact form, slider, gallery, or chat script on every page, even though only 1 or 2 pages use it.

Check the flagged file name in Lighthouse, find which plugin or theme owns it, and look for a setting in that plugin to load it only where it is used.

If the plugin has no such setting, use your caching plugin exclusion list to keep its script out of defer or delay, or use a plugin organizer to stop it loading on pages that do not need it.

For third-party scripts, defer them when you can, delay them until user interaction when the plugin supports it, and remove any tool you no longer use.

LiteSpeed Cache explains that its “Delayed” option runs JavaScript only after user activity such as a key press or mouse movement, while “Deferred” runs it as soon as the HTML finishes loading, in its Page Optimization docs.

That difference matters for forms and menus: a delayed script may leave a button dead until the visitor moves the mouse, so test every interactive part after you turn delay on.

How do you check that the fix worked?

Run Lighthouse again on the same page, on the same device type, and compare the flagged files and the time saved with your first run.

A clean result means no render-blocking files are listed, or the listed files save so little time that the audit passes.

Check First Contentful Paint and Largest Contentful Paint in the same report, since render-blocking files delay both, and a fix that helps one should help the other.

Also open the page in a private window on a phone, scroll through it, and click every menu, form, slider, and checkout button before you call the job done.

If you use WP Rocket, its Core Web Vitals setup guide explains the plugin settings in one place.

The WP Rocket settings guide covers each “File Optimization” option in detail.

For LiteSpeed sites, the LiteSpeed Cache settings guide walks through the same “Page Optimization” tabs.

The setup guide for LiteSpeed Cache with QUIC.cloud covers the cloud service behind critical CSS.

Keep a short log with the date, the page, the settings changed, and the before and after Lighthouse figures, so you can undo a change that caused a problem.

What mistakes should you avoid?

Deferring or delaying every script at once is the most common mistake, because it breaks menus, forms, and sliders that depend on order.

Turn on 1 change at a time, clear the cache, and test the page before you turn on the next change.

Do not inline a large stylesheet, because inlining more than a small critical set makes the HTML larger on every page load and can slow the first paint instead of helping it.

Do not chase a score of 100 at the cost of a working site, since a page that loads fast but has a dead checkout button loses more than a page with 1 small render-blocking file left.

Avoid combining CSS and JavaScript files without testing, because a combined file can break styles that depend on load order, as LiteSpeed warns in its docs.

Finally, do not forget mobile: test a phone view after each change, because mobile visitors have slower networks and less CPU power, so a file that looks harmless on desktop can still delay the first paint on a phone. For context on why speed matters for search, see how page speed affects SEO.

Frequently asked questions

Can I remove all render-blocking resources from WordPress?

You can remove most of them, but not always all of them. Some CSS and JavaScript must load before the first paint so the page looks right and works. Aim to remove unused code, defer what can wait, and inline critical CSS. A small file that saves only a few milliseconds is often fine to leave alone.

Is defer better than async for WordPress scripts?

Defer is usually better for WordPress theme and plugin scripts, because deferred scripts run in order after the page has been parsed. Async is better only for independent scripts, such as analytics, that do not depend on other scripts or on the page structure. If a script depends on jQuery or on another file, use defer, not async.

Why does my site look broken after I remove unused CSS?

The tool may have removed styles that only appear after an interaction, such as a menu opening, a popup, or a mobile layout. Add the missing class, ID, or file to the plugin safelist, regenerate the used CSS, and clear the cache. Test the page on desktop and mobile, and check menus, forms, and sliders before you move on.

Should I use WP Rocket or LiteSpeed Cache to fix render-blocking resources?

Use the plugin that matches your hosting and your current setup. WP Rocket works on most hosts and offers Remove Unused CSS, deferred JavaScript, and delayed JavaScript in one place. LiteSpeed Cache offers similar CSS and JavaScript options, plus critical CSS through QUIC.cloud. Do not run both at once, because two optimization plugins can conflict.

How long does it take to fix render-blocking resources?

A simple site with one caching plugin can take 30 to 60 minutes, including testing. A site with many plugins, a page builder, and third-party scripts can take several hours, because each flagged file needs to be traced to its owner and tested after the change. Allow extra time if you need to add exclusions for menus, forms, or sliders.

Do render-blocking resources affect my search rankings?

They can affect rankings indirectly, because they delay First Contentful Paint and Largest Contentful Paint, which are part of Core Web Vitals. Google uses Core Web Vitals as one of many ranking signals, so a faster first paint helps, but it does not replace good content, links, and relevance. Fix the worst files first and keep the site working well.

Sources

  1. Eliminate render-blocking resources Chrome for Developers
  2. Understand the critical rendering path web.dev
  3. Optimize resource loading web.dev
  4. wp_enqueue_script() WordPress Developer Resources
  5. Page Optimization LiteSpeed Documentation
  6. Find the best settings for your site WP Rocket Documentation
  7. Critical CSS in WordPress WP Rocket
  8. Extract critical CSS web.dev

Is your product missing, or something out of date?

Tell us what to add or correct. We read every note and reply when we need a source. A message does not buy a ranking.

About the editors

WPLegible editors

Researched from the primary sources listed above and checked against our editorial rules. About the site · How we test