tech
How to fix: No render-blocking <script> in <head>
Why this matters
Synchronous <script> tags in <head> block HTML parsing until they load + execute. The result: delayed First Contentful Paint and LCP. Adding `defer` or `async` lets the browser keep parsing while the script downloads.
Background
Synchronous <script> in <head> blocks HTML parsing until the script loads + executes. Result: delayed FCP and LCP. Adding `defer` or `async` lets parsing continue.
References
web.dev · Eliminate render-blocking resources
How to fix
Code snippet for each stack we cover. Pick the one matching your server / framework.
nginx
No server config — template change.
apache
Same.
cloudflare
Workers/Pages can rewrite script tags at the edge — useful if you can't change the source HTML.
wordpress
Most theme issues come from analytics + plugins. Use 'Async JavaScript' or 'WP Rocket' to add defer to all non-critical scripts.
flask
Audit your <head>. Add `defer` to every `<script src=...>` that isn't critical-path. Use `type="module"` for ES modules (deferred by default).
express
Same.
rails
Sprockets supports `data-turbo-track` + `defer`. Use it.
Verify it's working
View source. Every `<script src=...>` in <head> should have either `defer`, `async`, or `type="module"`.
Want to know if your site has this issue?
Run a free 53-check audit — security, GDPR, NIS2, and technical SEO.
Audit my site →