JavaScript to Footer


The Yahoo! Exceptional Performance team recommends placing scripts at the bottom of your page because of the way browsers download components.

"The problem caused by scripts is that they block parallel downloads. The HTTP/1.1 specification suggests that browsers download no more than two components in parallel per hostname. If you serve your images from multiple hostnames, you can get more than two downloads to occur in parallel. While a script is downloading, however, the browser won't start any other downloads, even on different hostnames.

In some situations it's not easy to move scripts to the bottom. If, for example, the script uses document.write to insert part of the page's content, it can't be moved lower in the page. There might also be scoping issues. In many cases, there are ways to workaround these situations."

WordPress default behavior is to load JavaScript in the <head> page.

This plugin will move all javascript code to the footer if the plugins have declared JavaScript properly.

Download

dl JavaScript to Footer

Installation

1. Upload the whole plugin folder to your /wp-content/plugins/ folder.

2. Go to the Plugins page and activate the plugin.

3. Try your blog and check if all plugins work properly. Footer JavaScript may break some plugins so check everything first!

Frequently Asked Questions

How do I correctly use this plugin?

Just enable the plugin and check your blog pages. If all plugins appear to be working correctly you are set!

Additionally you may install YSlow enchancment for Firebug, a popular addon for Firefox browser. YSlow will help you determine your site choke points.

Other

You can also visit my other WordPress Plugins.

If you are looking for WordPress services, feel free to contact me.

Comments:

69 Comments

  1. rap dinle
    May 3rd, 2009

    This is exactly what I needed. My site feels much faster now...
    Thank you...

  2. Hamilton
    May 2nd, 2009

    It would be good if you add a configuration page for the plugin to manually include javascript that must stay in the header. I have a top bar in my blog and the javascript must be at the top, after activating the plug-in it stopped working. Please, implement something to include javascript exclusions.

  3. tobyct
    Apr 18th, 2009

    As I mentioned above, nice plug in and it has speeded up my load time. I have only just noticed though that it stops CommentLuv from working.

  4. Andy
    Apr 14th, 2009

    Just amazing. Works exactly as described. Site is running WP 2.7 too and no problems found so far. Thanks!

  5. Frank
    Apr 9th, 2009

    That is so cool. This plugin works so amazingly. My site has become a zoom zoom site, it loads instantly and is working so smoothly. Cool man. Nice plugin.

  6. Yiğit Özdamar
    Apr 4th, 2009

    Dude,
    I realized that there is new version of "Footer Javascript" plug-in but something wrong with that. I couldnt update it. Just for your information.

  7. Yiğit Özdamar
    Apr 1st, 2009

    Thanx Vlad! It works great!

  8. Rahul Chowdhury
    Mar 25th, 2009

    This plugin is great. Thanks for it. I will try it.

  9. toby
    Mar 19th, 2009

    Hi Vladimir,
    Thank you for the plugin. Has cut the load time for my site considerably.

    T.

  10. krmd
    Feb 23rd, 2009

    I think it works on scripts that i created. I use wp_enqueue_script function.
    It doesnt work for plugin named wp-postratings.
    It uses wp_register_script to register and wp_print_scripts to print.

  11. Kyle
    Jan 30th, 2009

    Thank you! This is exactly what I needed. My site feels much faster now.

  12. Jan 13th, 2009

    I didn't check Viper's plugin but it can be that either it does not use Javascript according to WordPress standards or it has some other specialized usage of it preventing it to be moved to the footer.

  13. Alex
    Jan 13th, 2009
  14. Andrea Hill
    Dec 26th, 2008

    Thanks so much! It's always bugged me to have the scripts up in the head.

    Now we just need to figure out how to prevent other plugins from writing to the head on page load :)

  15. I-MAN
    Dec 23rd, 2008

    Doesn't work with wordpress 2.7

    check this site source code for example http://www.wrestlingfans.co.cc.

    if its compability with other plugins then here are list of plugins i installed:

    Akismet 2.2.3
    Contact Form 7 1.9
    Footer Javascript 0.3
    Google XML Sitemaps 3.1.1
    MCEComments 0.4.6-1
    Post Tabs 2.7
    SI CAPTCHA 1.3.2
    Sidebar Login 2.1.4
    Sociable 3.0.2
    Twitme 1.6.5
    WordPress.com Stats 1.3.5
    WP-PageNavi 2.40
    WP-PostViews 1.40
    WP Security Scan 2.3
    WP Widget Cache 0.25.1

    • boyz27
      Aug 5th, 2009

      need more wp's rescipe..
      mine doesn't load faster....i'll try the footer-javascript.

  16. Ajay Kumar Singh
    Dec 20th, 2008

    Kool plugin and it works perfectly. I haven't tried the super cache plugin so can't say if it breaks that or not as pointed out by other guy.

  17. hesicong
    Dec 20th, 2008

    Very pleased! This worked! Thank you!

  18. Vadim P.
    Dec 19th, 2008

    Found a small issue - this plugin stops doing it's job when wp super cache returns a cached page. When the page isn't cached though, it's fine.

    Is it possible to have the plugin do it's job before the cache cahes?

  19. Vadim P.
    Dec 19th, 2008

    Thanks, it worked.

  20. Angelo Gon
    Dec 12th, 2008

    Great !

    Works fine even WP 2.7, no error until now

  21. Paul Dymon
    Dec 11th, 2008

    Thanks Vlad,
    Loaded the plugin, dumped my browser cache, blog load was very fast with no side effects. Thanks... again...

    I do have an issue in my blog. When a category is clicked I get two lines of "click to continue reading" Only in a category list. Can you point me to the code to correct this? I want to keep your text line and dump the duplicate.

    regards,
    Paul

  22. Hackadelic
    Dec 11th, 2008

    Hey, great! You've already integrated my proposal! That was quick! :)

    Again: Many thanks for the useful stuff you share!

  23. Ideas
    Dec 10th, 2008

    Download link is not working :(

  24. Mike
    Dec 4th, 2008

    Hi Vlad,
    I gave it a shot and found out it didn't work with my NextGen Gallery widget. It wouldn't load it and gave an error.

  25. Jure
    Dec 4th, 2008

    Great plugin! Works like a charm

Have your say

Your email is never published nor shared. Required fields are marked *

*
*

Subscribe without commenting

About

vladimir prelovac Vladimir Prelovac is CEO of Prelovac Media, a computer engineer by profession and an adventurer by state of mind. more +


"I would love to change the world, I just don't have the source code yet."

Services

Manage multiple WordPress sites

Built for WordPress enthusiasts, ManageWP helps you manage all your WordPress sites from one central location.

Books

WordPress Plugin Devleopment Book Read my book WordPress Plugin Development: Beginner's Guide

Published by Packt Publishing, available online through Amazon.