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: April 8, 2018

Latest News: I have added another link to the menu 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.

Speed Booster Pack Tutorials

WordPress Speed Booster Pack Advanced Settings

Step 1 ) The following image Exclude scripts from being moved to the footer allows you to add up to 4 different script handle from being moved to the footer.

The following list shows you the script handle detected in this site. These are the handles that you would add in the field if you decided to exclude them from being moved to the footer.

Note: The plugin will detect different script handles in your site. 

Script Handle Detected

  • Script Handle = comment-reply / Script Path = /wp-includes/js/comment-reply.min.js
  • Script Handle = wp-embed / Script Path = /wp-includes/js/wp-embed.min.js

wordpress-speed-booster-pack-advanced-script-handle

Exclude scripts from being deferred

Step 2 ) 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;
}

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

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 RuizManuel 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)