Support » Plugin: Fast Velocity Minify » Disable FVM on a single page?

  • Resolved utrenkner


    I like FVM a lot – it works just great!

    Just one question: Is there any way to disable FVM for a single page or template?

    Background of this question: I have one page, which uses disgusting table based layout with many conditional comments (an e-mail-newsletter designed with MJML, to please all those e-mail clients not understanding modern CSS). I absolutely do not want any plugin – including FVM – to mess with that code. Could I disable the plugin for this page (this template)? Or specifically: Could I disable the HTML minification, but use it on all other pages/posts?


Viewing 2 replies - 1 through 2 (of 2 total)
  • Plugin Author Raul Peixoto


    Its not supported by default, however you can code an auxiliary function that runs when the requested url, matches some specific pattern OR by page number / title using conditional tags.

    You need to know a little of php coding or hire a developer for that though.
    Once you come up with the logic to run something on that url, you can call these filters to prevent FVM from doing anything on that page:

    remove_action('wp_print_scripts', 'fastvelocity_min_merge_header_scripts', PHP_INT_MAX );
    remove_action('wp_print_footer_scripts', 'fastvelocity_min_merge_footer_scripts', 9.999999 ); 
    remove_action('wp_print_styles', 'fastvelocity_min_merge_header_css', PHP_INT_MAX ); 
    remove_action('wp_print_footer_scripts', 'fastvelocity_min_merge_footer_css', 9.999999 );
    remove_action('wp_print_styles', 'fastvelocity_add_google_fonts_merged', PHP_INT_MAX);
    remove_action('wp_print_footer_scripts', 'fastvelocity_add_google_fonts_merged', PHP_INT_MAX );
    remove_action('init', 'fastvelocity_min_disable_wp_emojicons');
    remove_action('template_redirect', 'fastvelocity_min_html_compression_start', PHP_INT_MAX);
    remove_filter('style_loader_src', 'fastvelocity_remove_cssjs_ver', 10, 2);
    remove_filter('script_loader_tag', 'fastvelocity_min_defer_js', 10, 3); 

    @alignak Thank you so much!

    It took a little reading/trying to find out, where to put the remove_action. But now it works as intended! Great!

    Maybe someone else will need this info too: I put this in the functions.php of my child theme to prevent html minification on the page with the stub “email-newsletter”.

    add_action('template_redirect', 'remove_htmlmin_in_newsletter');
    function remove_htmlmin_in_newsletter() {
            remove_action('template_redirect', 'fastvelocity_min_html_compression_start', PHP_INT_MAX);
Viewing 2 replies - 1 through 2 (of 2 total)
  • You must be logged in to reply to this topic.