• Resolved oribrn

    (@oribrn)


    Hi,

    I want exclude a plugin component from html minification because when I enable it on the whole website, it doesn’t display properly.

    How can i do it?

Viewing 1 replies (of 1 total)
  • Plugin Support Delyan Delov

    (@delyandelov)

    Hello @oribrn,

    You can use the Exclude functionalities our plugin provides. The exclusion can be done within the plugin dashboard:

    SG Optimizer -> Frontend -> General -> Exclude from HTML Minification

    or you can use the following filters for excluding specific query parameters:

    add_filter( 'sgo_html_minify_exclude_params', 'html_minify_exclude_params' );
    function html_minify_exclude_params( $exclude_params ) {
        // Add the query params that you want to exclude.
        $exclude_params[] = 'test';
    
        return $exclude_params;
    }

    or excluding specific URLs:

    add_filter( 'sgo_html_minify_exclude_urls', 'html_minify_exclude' );
    function html_minify_exclude( $exclude_urls ) {
        // Add the url that you want to exclude.
        $exclude_urls[] = 'https://mydomain.com/page-slug';
    
        return $exclude_urls;
    }

    The above filters should be added to the functions.php file of your active theme. More information on how to use our filters can be found here:

    https://www.ads-software.com/support/topic/how-to-use-sg-optimizers-filters-procedure/

Viewing 1 replies (of 1 total)
  • The topic ‘How to exclude plugin component from html minification’ is closed to new replies.