How to Put All JavaScripts at Bottom in WordPress

October 9, 2013

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.

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);
Muhammad Dilawar
Muhammad Dilawar
Muhammad Dilawar is a WordPress developer and technical SEO specialist with over 12 years of experience building, optimizing, and maintaining websites. He specializes in WordPress, WooCommerce, server optimization, DNS, Cloudflare, website security, and performance improvements. Through Softstribe, he shares practical guides, tutorials, and industry insights based on real-world experience helping businesses grow their online presence.
More from Muhammad Dilawar