Title: IMPROVEMENT : ADD async for javascript
Last modified: August 24, 2016

---

# IMPROVEMENT : ADD async for javascript

 *  [Emmanuel Simond](https://wordpress.org/support/users/emanwebdev/)
 * (@emanwebdev)
 * [11 years ago](https://wordpress.org/support/topic/improvement-add-async-for-javascript/)
 * SUGGESTION
 * add `async` to defer loading of JavaScript in order to remove/improve Render-
   Blocking JavaScripts
 * as per [https://developers.google.com/speed/docs/insights/BlockingJS#deferJS](https://developers.google.com/speed/docs/insights/BlockingJS#deferJS)
 * Fix:
    file /bwp-minify/includes/class-bwp-minify.php:2723
 *     ```
       case 'script':
       	$return  = "<script async type='text/javascript' src='"
       		. esc_url($string)
       		. "'></script>\r\n";
       	break;
       ```
   
 * [https://wordpress.org/plugins/bwp-minify/](https://wordpress.org/plugins/bwp-minify/)

Viewing 3 replies - 1 through 3 (of 3 total)

 *  Thread Starter [Emmanuel Simond](https://wordpress.org/support/users/emanwebdev/)
 * (@emanwebdev)
 * [11 years ago](https://wordpress.org/support/topic/improvement-add-async-for-javascript/#post-6168993)
 * see [Parser Blocking vs. Asynchronous JavaScript](https://developers.google.com/web/fundamentals/performance/critical-rendering-path/adding-interactivity-with-javascript#parser-blocking-vs-asynchronous-javascript)
 * Adding the async keyword to the script tag tells the browser that it should not
   block the DOM construction while it waits for the script to become available –
   this is a huge performance win!
 *  [gioni](https://wordpress.org/support/users/gioni/)
 * (@gioni)
 * [11 years ago](https://wordpress.org/support/topic/improvement-add-async-for-javascript/#post-6169157)
 * First of all, suggested attribute is a new HTML 5 attribute. What about non-HTML
   5 sites? Secondly, what about order of loading? How you will control it? Imagine
   that some script, which depends on jQuery will loaded before jQuery script? Thirdly,
   what about inline JavaScript code that depends on jQuery or any external script?
   
   Why not move scripts to the footer?
 *  [stevejbrobinson](https://wordpress.org/support/users/stevejbrobinson/)
 * (@stevejbrobinson)
 * [10 years, 11 months ago](https://wordpress.org/support/topic/improvement-add-async-for-javascript/#post-6169236)
 * Maybe make this a configuration option so when using a service like Cloudflare
   we can add `data-cfasync='true'`
    Emmanuel Simond – thanks for the hack in the
   mean time;)

Viewing 3 replies - 1 through 3 (of 3 total)

The topic ‘IMPROVEMENT : ADD async for javascript’ is closed to new replies.

 * ![](https://s.w.org/plugins/geopattern-icon/bwp-minify.svg)
 * [Better WordPress Minify](https://wordpress.org/plugins/bwp-minify/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/bwp-minify/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/bwp-minify/)
 * [Active Topics](https://wordpress.org/support/plugin/bwp-minify/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/bwp-minify/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/bwp-minify/reviews/)

 * 3 replies
 * 3 participants
 * Last reply from: [stevejbrobinson](https://wordpress.org/support/users/stevejbrobinson/)
 * Last activity: [10 years, 11 months ago](https://wordpress.org/support/topic/improvement-add-async-for-javascript/#post-6169236)
 * Status: not a support question