Unlock Special Pricing for a Limited Time – GET 70% OFF NOW!

SpeedyGo
  • Feature
  • Pricing
  • Blog
  • Documentation
  • FAQ
  • Run Test
  • Login
It's Free Download Now
Login

Caching & Preloading

  • optimization presets
  • Scheduled Expiration & Auto Purge
  • Cache Warm-Up
  • Cache Preloading
  • Mobile Caching
  • Object Caching
  • Browser Caching
  • Full-Page Caching

Asset Optimization

  • CSS Optimization
  • JavaScript Optimization
  • JS Interaction Delay
  • JavaScript Combination
  • CSS Combination
  • JavaScript Minification
  • CSS Minification
  • HTML Minification

Compression

  • Defer Scripts
  • Brotli Compression
  • Gzip Compression

Image Optimization (Pro)

  • image media optimization
  • cdn integration
  • Recommended Configuration (Pro Users)
  • Lazy Load
  • WebP Quality Control
  • Conversion Scope Rules
  • Enable WebP Conversion

PageSpeed & Analytics (Pro)

  • PageSpeed Analytics
  • Mobile vs Desktop Tracking
  • Google PageSpeed API Integration

System & Developer Tools

  • import export settings

Troubleshooting

  • API Key
View Categories
  • Home
  • Docs
  • Compression
  • Defer Scripts

Defer Scripts

Defer Scripts adds the defer attribute to JavaScript <script> tags. Deferred scripts download in parallel with HTML parsing but only execute after the full HTML document has been parsed. This prevents JavaScript from blocking the browser from rendering the page.

Dashboard path: Cache Settings → Asset Optimization
Section: CSS & JS Optimization

Defer Scripts

Settings #

SettingTypeDescription
Defer ScriptsToggleAdds defer to eligible script tags across the site.
Exclude JS FilesText areaOne file path or URL keyword per line. Scripts matching these are left untouched and load normally.

How to Enable #

  1. Go to Cache Settings → Asset Optimization.
  2. Under CSS & JS Optimization, toggle Defer Scripts to ON.
  3. Click Save Changes.
  4. Visit your site and test all interactive elements: menus, sliders, popups, checkout forms, chat widgets.
  5. If anything breaks, add the problematic script path to Exclude JS Files and save again.

What to Exclude #

Scripts that must run before the page is interactive should be excluded:

/wp-content/plugins/some-plugin/script.js
/wp-content/themes/my-theme/critical.js
google-analytics
intercom
crisp

Partial matches work — entering intercom will match any script URL containing that string.

When to Use #

SituationRecommendation
Site has many third-party scripts (analytics, chat, ads)Use Defer Scripts — most of these can safely defer
Site uses jQuery-dependent themeTest carefully; some themes break if jQuery is deferred
PageSpeed score is penalised for “render-blocking resources”Defer Scripts directly fixes this warning
Site has a JS-driven hero or slider visible above the foldExclude that script so the hero loads immediately

Troubleshooting #

SymptomLikely causeFix
Navigation menu doesn’t openMenu JS is being deferredAdd the theme’s main JS file to Exclude JS Files
Slider/carousel is broken on loadSlider script deferred past its init timingExclude the slider script
WooCommerce add-to-cart brokenWooCommerce JS deferredAdd woocommerce to Exclude JS Files
Chat widget doesn’t appearChat script deferredExclude the chat provider script (e.g. crisp, intercom)

Tips #

Tip: Use your browser’s DevTools (F12 → Console) to identify which script is causing an error after enabling Defer Scripts. The error will name the script file — add that to the exclusion list.

Note: defer has no effect on inline <script> blocks — only external script files. If a plugin uses inline scripts, they will always execute in order regardless of this setting.

Updated on May 26, 2026

Share This Article :

  • Facebook
  • X
  • LinkedIn
  • Pinterest
Gzip CompressionBrotli Compression
Table of Contents
  • Settings
  • How to Enable
  • What to Exclude
  • When to Use
  • Troubleshooting
  • Tips
SpeedyGo
  • Support Ticket
  • Feature
  • Documentation
  • Blog
  • FAQ
  • Get SpeedyGo

SpeedyGo is built to make your WordPress site faster, lighter, and easier to manage. From caching to compression, we simplify performance so you can focus on growing your website.

©2026 SpeedyGo. All rights reserved.

  • Privacy Policy
  • Refund Policy
  • Terms and Conditions
  • Privacy Disclosure