• Resolved Salih K

    (@salihkulangara)


    I have an issue with Gravityforms while using combining and minifying JS options. their redirect processor not working and getting a console error, so they are asking to exclude Minifying and combining JS for this particular page. Is there a way to do this.

    I was trying to exclude the gravityform js entirely using Exclude from JavaScript Minification/JavaScript Combination field but it is not getting listed in Minify JavaScript Files/Combine JavaScript Files fields, why it is so?

    In this particular case the issue happens when I enable “Combine JavaScript Files” option, but I dont see the GF js files listed to exclude. see https://snipboard.io/07QPND.jpg

    • This topic was modified 3 years, 6 months ago by Salih K.
Viewing 2 replies - 1 through 2 (of 2 total)
  • Plugin Author Stoyan Georgiev

    (@stoyangeorgiev)

    Hey there @salihkulangara,

    I am afraid that it is not possible to exclude scripts for specific pages through the plugin menu.

    If the script is not being present in the drop-down menu, most probably it is not enqueued properly. If you have such script, you can still use the filter we have added.

    add_filter( 'sgo_js_minify_exclude', 'js_minify_exclude' );
    function js_minify_exclude( $exclude_list ) {
        $exclude_list[] = 'script-handle';
        $exclude_list[] = 'script-handle-2';
    
        return $exclude_list;
    }

    If you need it exclude it from js combination you can use the following filter:

    add_filter( 'sgo_javascript_combine_exclude', 'js_combine_exclude' );
    function js_combine_exclude( $exclude_list ) {
        $exclude_list[] = 'script-handle';
        $exclude_list[] = 'script-handle-2';
    
        return $exclude_list;
    }

    If you have any issues, feel free to reach back to us.

    Kind regards,
    Stoyan

    Thread Starter Salih K

    (@salihkulangara)

    Thank you @stoyangeorgiev
    it works.

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Is it possible to exclude JS minification and combining for a certain page?’ is closed to new replies.