Skip to content

Instantly share code, notes, and snippets.

@vietrick
Created February 17, 2022 16:21
Show Gist options
  • Save vietrick/3e093ff657bb462cbda564e098736452 to your computer and use it in GitHub Desktop.
Save vietrick/3e093ff657bb462cbda564e098736452 to your computer and use it in GitHub Desktop.
Fully disable Gutenberg
// Fully Disable Gutenberg editor.
add_filter('use_block_editor_for_post_type', '__return_false', 10);
// Don't load Gutenberg-related stylesheets.
add_action( 'wp_enqueue_scripts', 'vietrick_remove_block_css', 100 );
function vietrick_remove_block_css() {
wp_dequeue_style( 'wp-block-library' ); // Wordpress core
wp_dequeue_style( 'wp-block-library-theme' ); // Wordpress core
wp_dequeue_style( 'wc-block-style' ); // WooCommerce Block
wp_dequeue_style( 'storefront-gutenberg-blocks' ); // Storefront theme
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment