0

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.

1

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)

  • ya, you are saying right. although all other js files which i used shifted to footer. – Moaz Ateeq Jan 9 '14 at 11:16
1

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

  • i tried alot, but didn't find the file although same technique i was using for other js files. – Moaz Ateeq Jan 9 '14 at 11:30
0

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.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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