How to add async or defer in all js file included in wordpress website
index.php
<!--?php function rj_script_tag_defer($tag, $handle) { if (is_admin()){ return $tag; } if (strpos($tag, '/wp-includes/js/jquery/jquery')) { return $tag; } else if($handle=='jquery' ) // if you want to ignore any js use this condition { return $tag; } if (strpos($_SERVER['HTTP_USER_AGENT'], 'MSIE 9.') !==false) { return $tag; } else { return str_replace(' src',' async="async" src', $tag); }}add_filter('script_loader_tag', 'rj_script_tag_defer',10,2);?-->
