Title: Move JavaScript to the bottom &#8211; please&#8230;
Last modified: August 21, 2016

---

# Move JavaScript to the bottom – please…

 *  Resolved [marcelstoer](https://wordpress.org/support/users/marcelstoer/)
 * (@marcelstoer)
 * [12 years, 8 months ago](https://wordpress.org/support/topic/move-javascript-to-the-bottom-please/)
 * It’s common practice to [move JavaScript-loading-code to the bottom](http://developer.yahoo.com/performance/rules.html#js_bottom)
   of the DOM just before the closing body tag to improve a site’s performance.
 * The WordPress function [`wp_enqueue_script`](http://codex.wordpress.org/Function_Reference/wp_enqueue_script)
   provides a parameter exactly for this (as does `wp_register_script`).
 * Please set this parameter to true. I manually edited `rotatingtweets.php` setting`
   $in_footer=true` everywhere – plugin still plays nice.
 * [http://wordpress.org/plugins/rotatingtweets/](http://wordpress.org/plugins/rotatingtweets/)

Viewing 5 replies - 1 through 5 (of 5 total)

 *  Plugin Author [Martin Tod](https://wordpress.org/support/users/mpntod/)
 * (@mpntod)
 * [12 years, 8 months ago](https://wordpress.org/support/topic/move-javascript-to-the-bottom-please/#post-4087264)
 * Good idea.
 * I don’t want to break the plug-in for people who don’t have `wp_footer()` in 
   their template, so I’ve added it as an option on the settings page in [the development version of the plug-in](http://downloads.wordpress.org/plugin/rotatingtweets.zip).
 * Martin
 *  Thread Starter [marcelstoer](https://wordpress.org/support/users/marcelstoer/)
 * (@marcelstoer)
 * [12 years, 8 months ago](https://wordpress.org/support/topic/move-javascript-to-the-bottom-please/#post-4087275)
 * Yes, I had thought about this. Adding an option is…always an option 😉 However,
   I see cases like this always as a good opportunity to find out whether themes
   follow the WordPress principles or not. I accept that plugin authors have a slightly
   different take on this.
 *  Plugin Author [Martin Tod](https://wordpress.org/support/users/mpntod/)
 * (@mpntod)
 * [12 years, 8 months ago](https://wordpress.org/support/topic/move-javascript-to-the-bottom-please/#post-4087353)
 * The WordPress default is to put the script at the top! I’m not sure why – but
   if you do something like:
 *     ```
       wp_enqueue_script('jquery');
       ```
   
 * (which uses default settings) then JQuery will appear at the top of the page.
   Setting `in_footer` as `false` is a change to the default.
 * It’s also what most plug-ins do (by default).
 * Now, the [development version of Rotating Tweets](http://downloads.wordpress.org/plugin/rotatingtweets.zip)
   gives you a choice!
 * Martin
 *  Thread Starter [marcelstoer](https://wordpress.org/support/users/marcelstoer/)
 * (@marcelstoer)
 * [12 years, 8 months ago](https://wordpress.org/support/topic/move-javascript-to-the-bottom-please/#post-4087361)
 * Thanks for getting back to me (and thanks for the plugin).
 * In all the years using WP I never found a good reason why WP should put its scripts
   at the top by default.
 * > Setting in_footer as false is a change to the default
 * I guess this should read “in_footer as true…”
 * > It’s also what most plug-ins do (by default).
 * Yes, it’s all too easy to use the default because `in_footer` is even optional.
   Why bother considering the options…
    That’s why I contact the authors of all 
   the plugins I use and ask them to reconsider their implementation.
 *  Plugin Author [Martin Tod](https://wordpress.org/support/users/mpntod/)
 * (@mpntod)
 * [12 years, 8 months ago](https://wordpress.org/support/topic/move-javascript-to-the-bottom-please/#post-4087381)
 * Good point.
 * As said, the development version (and next release) will include this as an option.
 * I need to update the explanatory text on the options page – and also give people
   options for caching – and then will be releasing the new version.
 * Martin

Viewing 5 replies - 1 through 5 (of 5 total)

The topic ‘Move JavaScript to the bottom – please…’ is closed to new replies.

 * ![](https://s.w.org/plugins/geopattern-icon/rotatingtweets.svg)
 * [Rotating Tweets (Twitter widget and shortcode)](https://wordpress.org/plugins/rotatingtweets/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/rotatingtweets/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/rotatingtweets/)
 * [Active Topics](https://wordpress.org/support/plugin/rotatingtweets/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/rotatingtweets/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/rotatingtweets/reviews/)

## Tags

 * [performance](https://wordpress.org/support/topic-tag/performance/)

 * 5 replies
 * 2 participants
 * Last reply from: [Martin Tod](https://wordpress.org/support/users/mpntod/)
 * Last activity: [12 years, 8 months ago](https://wordpress.org/support/topic/move-javascript-to-the-bottom-please/#post-4087381)
 * Status: resolved