• hello
    i write in the function.php

    add_action( 'wp_enqueue_scripts', 'load_style' );
    function load_style() {
        wp_dequeue_style('mailpoet_public');
        wp_deregister_style('mailpoet_public');
    }
    add_action( 'wp_enqueue_scripts', 'load_scripts' );
    function load_scripts() {
        wp_deregister_script( 'mailpoet_public' );
    }

    but css and js are not disable (deregister).
    wtf why?

    • This topic was modified 7 years, 3 months ago by vinograd10.
Viewing 2 replies - 1 through 2 (of 2 total)
  • Hi @vinograd10,

    Why are you trying to deregister the scripts and styles? Styles can be overridden with CSS.

    Thanks!

    I have the same problem and need. The reason is simple, you render one of your css outside of header, in the body. And when you use caching plugins it is not combining it and it is being left below some js files. And that hears page speed rating.
    So please comply to general equeuing rules.

Viewing 2 replies - 1 through 2 (of 2 total)

The topic ‘disable or deregister css and js’ is closed to new replies.