Yesterday, when I was just looking for new emails in my inbox I found an interesting question about how to put all JavaScripts at bottom in WordPress. Did you know that why should we put JavaScripts at bottom? Because, it’s an effective way to load all the scripts at bottom in WordPress that boost the website speed. One of our visitors asked us how they can move JavaScripts at the bottom in WordPress to increase Google pagespeed score for their blog. In this article, I will show you how to put all JavaScripts at bottom in WordPress, so that you will be able to improve your site load time and your Google pagespeed score.

javascripts to bottom in wordpress

Putting All JavaScripts at Bottom in WordPress

All you need to do is to add the following line of codes in your functions.php file.

remove_action('wp_head', 'wp_print_scripts');
remove_action('wp_head', 'wp_print_head_scripts', 9);
remove_action('wp_head', 'wp_enqueue_scripts', 1);
add_action('wp_footer', 'wp_print_scripts', 5);
add_action('wp_footer', 'wp_enqueue_scripts', 5);
add_action('wp_footer', 'wp_print_head_scripts', 5);