How to exclude plugin component from html minification

[ad_1]

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[] = 'http://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:

 

This site will teach you how to build a WordPress website for beginners. We will cover everything from installing WordPress to adding pages, posts, and images to your site. You will learn how to customize your site with themes and plugins, as well as how to market your site online.

Buy WordPress Transfer