WordPress tip move all JavaScript files to the footer automatically

 In All, Optimization & Best Practices, SEO, WordPress Theme Development

In order to improve the loading time of your WordPress blog, it is recommended that you move JavaScript files to the bottom of your HTML documents. Unfortunately, it isn’t always as easy as it seems, especially when using some plugins who inject code in the header. Here’s a simple solution to automatically move all JavaScript files to the bottom.

First, open your functions.php file and paste the following code in it:

Once done, edit your header.php file. Replace the wp_head() tag by this:
Recommended Posts
Showing 4 comments
  • frank

    What’s up, I read your new stuff daily. Your writing style
    is awesome, keep doing what you’re doing!

  • couronne dentaire

    It’s actually a cool and useful piece of information. I’m glad that you simply
    shared this helpful info with us. Please stay us up to date like
    this. Thank you for sharing.

  • Burton Haynes

    Really good info. Thank You for sharing!

  • Detox

    Wonderful information. I wish other information I stumbled on was this exceptional. Keep up the great job.

Leave a Comment

Contact Us

We're not around right now. But you can send us an email and we'll get back to you, asap.

Start typing and press Enter to search

Custom CSS Styles for Recent PostsWordPress Custom Registration Form with Bootstrap