FEATURE REQUEST: option to load the script with `defer` attribute.
See original GitHub issueI don’t want the gtag.js to load on my site like this:
<script async="" src="https://www.googletagmanager.com/gtag/js?id=UA-159330658-2&l=dataLayer" charset="utf-8"></script>
I want it like this
<script defer src="https://www.googletagmanager.com/gtag/js?id=UA-159330658-2&l=dataLayer" charset="utf-8"></script>
Here is how it impacts the site.

Please provide an option for this.
Issue Analytics
- State:
- Created 3 years ago
- Comments:5 (3 by maintainers)
Top Results From Across the Web
How to Defer Parsing of JavaScript in WordPress (4 Methods)
Make sure to replace “defer.js” with the actual file name/path of the JavaScript file that you want to defer. Then, you can use...
Read more >Efficiently load JavaScript with defer and async
In doing so, the script is loaded and executed after all the page is already parsed and loaded, which is a huge improvement...
Read more >Defer Attribute (Chrome) - javascript
The purpose of defer is to tell the externally linked script to wait until the page finishes loading until it runs. The same...
Read more >The Defer Attribute Explained
In this tutorial, you will learn about the defer attribute and how it can be used within your web pages to improve page...
Read more >The Script element - HTML: HyperText Markup Language
Scripts with the defer attribute will prevent the DOMContentLoaded event from firing until the script has loaded and finished evaluating.
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found

🎉 This issue has been resolved in version 1.11.0 🎉
The release is available on:
Your semantic-release bot 📦🚀
I’ve added the
deferScriptLoadboolean option in the list of plugin options