Take the 2-minute tour ×
WordPress Development Stack Exchange is a question and answer site for WordPress developers and administrators. It's 100% free, no registration required.

while testing for page speed, i found 2 js files that causes the speed delay, according to PageSpeed Insight. files names are

  1. /wp-includes/js/swfobject.js
  2. /wp-includes/js/comment-reply.min.js

how can i moved these files into the footer, currently both files are loading in header.

share|improve this question

3 Answers 3

You should not disturb core files, lets say even if you copy those files in footer and tomorrow wordpress releases another new version, and you update it. The files that you moved from /wp-includes/js/... will be back. In my opnion, try to minimize them. Although you be fine with wordpress core files, when optimizing your site and focus on optimizing html and css (and JS, if you made any)

share|improve this answer
    
ya, you are saying right. although all other js files which i used shifted to footer. –  Moaz Ateeq Jan 9 at 11:16

have you found the file which enqueues those jquery files??

if found then set the last parameter of the wp_enqueue_script() function to true;

<?php wp_enqueue_script( $handle, $src, $deps, $ver, $in_footer ); ?> 

For more details refer to : http://codex.wordpress.org/Function_Reference/wp_enqueue_script

share|improve this answer
    
i tried alot, but didn't find the file although same technique i was using for other js files. –  Moaz Ateeq Jan 9 at 11:30
up vote 0 down vote accepted

i used this Plugin Minit. this plugin combine JS and CSS files and serve them from the uploads folder. Although this plugin is not listed on Wordpress Plugin Directory, dnt no why. But it works for me.

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.