Fix guides · Performance
How to fix render-blocking requests (CSS and JavaScript)
Scripts and stylesheets that load before anything appears keep your page blank. How to defer what can wait, on Shopify, WordPress, Webflow, Wix, Squarespace and Next.js.
- Time to fix
- 30–90 minutes
- Skill needed
- Developer
- Who notices
- Every visitor: the page stays blank for longer
Why it matters
Before showing anything, the browser downloads every stylesheet and every ordinary script in the page's <head>, one after another. Each one adds waiting time with a blank screen.
Most scripts (analytics, chat, reviews, tracking) aren't needed for that first view. Loading them a moment later makes the page appear sooner without losing anything.
“Requests are blocking the page's initial render, which may delay LCP. Deferring or inlining can move these network requests out of the critical path.”
Before you start
- Your report lists each blocking file. Scripts are usually the easiest win: add the defer attribute, or load them from the end of the page.
- Stylesheets are needed to draw the page, so the fix is having fewer and smaller ones: remove ones you no longer use, and avoid chains of @import.
- Test after each change. A script that other code relies on immediately may break if deferred on its own.
Fix it on your platform
Shopify
- Apps are the most common source. In the theme editor (Online Store → Themes → Customize), open App embeds and turn off embeds for apps you don't need on every page.
- Apps you've removed can leave code behind: Shopify notes that some apps add code to your theme that isn't removed when you uninstall them. Check the app's instructions or ask its developer.
- In your theme code (Edit code → layout/theme.liquid), add defer to script tags in the <head> that aren't needed for the first view.
<script src="{{ 'reviews.js' | asset_url }}" defer></script>WordPress
- Plugins often add scripts and styles to every page. Deactivate the ones you don't use, and check whether busy plugins (sliders, forms, chat) can load only where they're needed.
- A performance plugin can defer JavaScript and trim CSS for you. Enable one feature at a time and check your pages after each.
- Theme and plugin developers can register scripts with a defer loading strategy (WordPress 6.3 and later).
wp_enqueue_script( 'reviews', get_template_directory_uri() . '/js/reviews.js', array(), '1.0', array(
'strategy' => 'defer',
'in_footer' => true,
) );Webflow
- Webflow's own files are managed by Webflow. What you control is custom code.
- In your site's or page's custom code settings, move third-party scripts out of the head code and into the code that loads before </body>, or add defer to them.
Wix
- Wix manages its own files. What you control is custom code: in your dashboard, go to Settings → Custom Code.
- For scripts that aren't needed straight away, change Place Code in to Body – end instead of Head.
Squarespace
- Squarespace manages its own files. What you control is code injection (available on Core, Plus and Advanced plans).
- Open the Code Injection panel and move scripts from the Header field to the Footer field, or add defer to them.
Next.js
- Next.js handles your own CSS and JavaScript. Blocking requests usually come from third-party <script> tags or font stylesheets added by hand.
- Load third-party scripts with next/script: the default afterInteractive strategy doesn't block the first paint, and lazyOnload waits until the browser is idle. Load fonts with next/font.
<Script src="https://widget.example.com/chat.js" strategy="lazyOnload" />Any other site
- Add defer to scripts in the <head> (or async for fully independent ones like analytics).
- Combine or remove stylesheets you don't need, and avoid @import inside CSS.
<script src="/js/app.js" defer></script>
<script src="https://analytics.example.com/a.js" async></script>“The goal is to load only what's needed, only when it's needed: defer non-critical scripts, import modules on interaction instead of at page load, and avoid heavyweight frameworks when Liquid and CSS can do the same job.”
Check that it's fixed
- Re-run your StudioLNC audit: fewer render-blocking requests should be listed.
- Click through key pages (menus, forms, checkout) to make sure deferred scripts still work.
Find every issue like this on your site
Free audit of performance, accessibility, SEO and security, with fixes for your platform.