More Gutenberg junk
Published January 29th, 2023 under Misc
It seems that every once in a while, I need to disable more Gutenberg rubbish messing with WordPress websites. WordPress core keeps adding more garbage which injects a lot of useless code bloat into pages. Previous posts about this, are here, here and here. I noticed this again today with the addition of another CSS file, so here is an updated Gutenberg junk removal script. You can add this into your theme, plugin, mu-plugin etc. to clean up your site.
<?php /** * Disable WordPress block editor CSS. */ function disable_gutenberg_junk() { wp_dequeue_style( 'wp-block-library' ); wp_dequeue_style( 'wp-block-library-theme' ); wp_dequeue_style( 'global-styles' ); wp_dequeue_style( 'wc-block-style' ); wp_dequeue_style( 'classic-theme-styles' ); } add_action( 'wp_print_styles', 'disable_gutenberg_junk', 100 );
Updates to this, will be provided on the Remove WordPress block CSS page.