How to dequeue / deregister parent theme style

It is pretty simple:

function remove_nada_theme_font_style() {
    remove_action( 'wp_enqueue_scripts', 'nada_theme_styles' );
}

add_action( 'after_setup_theme', 'remove_nada_theme_font_style' );

Since the child theme is loaded before the parent theme, you can’t simply remove the action. because the add_action calls in the parent theme will simply overwrite your requests. You have to wrap it into the after_setup_theme hook. This hook will fire after the child and parent theme is loaded. So all removing filters and actions from the parent theme should go there.

Source: http://code.tutsplus.com/articles/how-to-modify-the-parent-theme-behavior-within-the-child-theme–wp-31006

edit

This will remove the whole styles and not just the font scripts.

If you just want to deregister the font:

function remove_nada_theme_font_style() {
    wp_dequeue_style( 'fonts-style' );
    wp_deregister_style( 'fonts-style' );
}

add_action( 'after_setup_theme', 'remove_nada_theme_font_style' );

Leave a Comment