WP Manifestindependent plugin directory
manifest / performance / wp-script-async-defer

Script async and defer.

Add async and defer parameters to script tags when the values are set via wp_script_add_data.

by Kyle Reicks · github.com/kylereicks/wp-script-async-defer · website

0stars
0forks

Install

No release zip yet. The repository archive installs, but the folder name will carry the branch suffix and updates will not flow:

wp plugin install https://github.com/kylereicks/wp-script-async-defer/archive/refs/heads/master.zip

Add async and defer attributes to WordPress scripts

wp_script_add_data( 'script-handle', 'async', true );
wp_script_add_data( 'script-handle', 'defer', true );