Apr 062018
 

WordPress Speed Booster Pack Advanced Settings post shows you how to exclude script handle from being moved to the footer and more.

Last Updated: May 23, 2019

Latest News: I update the information below.

There are times that your site might not like moving certain scripts to the footer. In this post you will learn how to exclude script handle from being moved to the footer and script files from being deferred. This is important if your site has scripts that don’t like to be moved to the footer because it causes errors in the site.

Note: Read the warning in red carefully before you go ahead and start enabling these features without a backup plan in place.

Speed Booster Pack Tutorials

WordPress Speed Booster Pack Advanced Settings

Step 1 ) The following image Advanced Optimizations allows you to enable the following options.

Advanced Optimizations Settings

  • Enable instant.page (BETA)
  • Disable cart fragments (BETA
  • Remove Google Maps
  • Remove REST API Links
  • Remove all RSS feed links
  • Minify HTML

Step 2 ) The following image JavaScript Optimization allows you to enable the following options.

JavaScript Optimization Settings

  • Move scripts to footer
  • Defer parsing of JS files

Exclude scripts from being moved to the footer

Step 3 ) The following image allows you to Exclude scripts from being moved to the footer by filling out the fields available.

Script Handle Detected Sample

  • Script Handle = jquery-migrate ….. Script Path = /wp-includes/js/jquery/jquery-migrate.min.js

wordpress-speed-booster-pack-exlude-script-moving-footer

Exclude scripts from being deferred

Step 4 ) The following image Exclude scripts from being deferred allows you to enter up to 4 scripts from being deferred. 4 scripts is the default allowed option in the plugin. However in some cases you might need to add more than 4. You can use the following filter to include more than 4 scripts from being deferred.

Note: Adding more than 4 scripts from being deferred can compromise the performance in your site. Use the following filter with caution.


add_filter('sbp_exclude_defer_scripts', 'my_function_name_here');
function my_function_name_here( $array ) {
$array = ('script-handle-1','script-handle-2');
return $array;
}

Note: If the function above does not work for you, try the function in the following forum post.

wordpress-speed-booster-pack-advanced-exclude-script

Step 5 ) The following image CSS Optimization allows you to enable the following options.

CSS Optimization Settings

  • Inline all CSS
  • Minify all (previously) inlined CSS
  • Move all inlined CSS into the footer

Step 6 ) The following image Exclude CSS allows you to excludes styles from being inlined and/ or minified. Enter one per line, the handles of CSS or the final part of the style URL. Click on Save Changes button when you finish setting up the advanced options.

Troubleshooting Tips

Q1 My slider stopped working = In the old version, I couldn’t move scripts to the footer because it broke the slider – images never loaded – even with scripts excluded. After the upgrade, I have to switch off “Defer parsing of javascript files” for the slider to work.

Solution 1: Defer parsing of javascript files doesn’t make sense/shouldn’t be used in combination with “move scripts to footer”.

If you move all the scripts to the footer, deferring doesn’t have much effect (if any), since the DOM is already pretty much all loaded and there’s no more render blocking resources being loaded.

What I’m basically trying to say is that they should be mutually exclusive and use one or the other.

Also, if defer parsing of javascript files is breaking your slider, try excluding the file that you believe is the culprit. Add this file to the following field under “Exclude scripts from being deferred”. (Solution provided by @machothemes)

=======================================

That is all you need to do to exclude scripts from being moved to the footer and from being deferred.

Note: Take care when adding scripts in the fields above. If you enter the wrong script file or handle it can cause errors. 

Click on the following URL WordPress Speed Booster Pack Optimize Site Steps to learn more.

I will be updating this tutorial from time to time. Make sure you come back for the latest updates.

If you have any questions please let me know.

Enjoy.

Manuel Ballesta Ruiz is a web developer, Blogger and WordPress Enthusiast.

 Leave a Reply

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <s> <strike> <strong>

(required)

(required)