How to set Defer parsing of JavaScript


Why to use Defer parsing of JavaScript?

Using deferring parsing of JavaScript until page html to be executed, defer parsing reduce the initial load time of javascript.

There are two options for defer parsing of javascript
Deferred – delays the execution of the script until the HTML parser has finished.
Asynchronous – executes when the script is ready and doesn’t disrupt HTML parsing.

In wordpress website you can use the below code for defer or async

Note: If you are using any cache plugin then there is no need of such type of this code cause this will conflict with cache plugins.

Do you like my posts? Please let me know by dropping your valuable comments, also if you have any questions, please let’s know.


Please enter your comment!
Please enter your name here