Hi there,
there are some core style sheets you can remove if you’re not using core blocks in your build that can be dequeued with this snippet:
// remove block library styles
function db_dequeue_block_styles(){
wp_dequeue_style( 'wp-block-library' );
wp_dequeue_style( 'wp-block-library-theme' );
}
add_action( 'wp_enqueue_scripts', 'db_dequeue_block_styles', 100 );
There is also the core global styles, including the huge list of color variables, utility classes and the related SVG HTML that it adds for those Duo-tone color options on its blocks
// remove core global styles and SVG filter HTML
function db_remove_global_css_and_svg() {
remove_action( 'wp_enqueue_scripts', 'wp_enqueue_global_styles' );
remove_action( 'wp_body_open', 'wp_global_styles_render_svg_filters' );
}
add_action('init', 'db_remove_global_css_and_svg');
Of course you need to be sure that you don’t require those styles. Neither GP or GB rely on them. But please check carefully if you choose to remove.
You may want to consider disabling emojis as well, as that makes a javascript request. Read more here:
https://www.netmagik.com/how-to-disable-emojis-in-wordpress/
For GeneratePress specific improvements, there is an option in the Customizer > General where you can set the Dynamic CSS Print Method
to an External File and set the Cache dynamic CSS
Hope that helps
-
This reply was modified 2 years, 1 month ago by
David.