Control Gutenberg Editor with WPMasterToolKit's "Disable Gutenberg" module
The Gutenberg block editor has introduced a new way of managing content in WordPress. However, it's not always suitable for every project or workflow. If you prefer the classic editor or wish to disable Gutenberg on certain types of content, the Disable Gutenberg from WPMasterToolKit is the ideal solution.
Why disable Gutenberg?
Whether for reasons of compatibility with existing themes or plugins, or to maintain a simpler user experience for your customers, there are several cases where Gutenberg may not be desirable. With Disable GutenbergYou have full control to activate or deactivate the block editor according to your needs.
Main features of the Disable Gutenberg module
- Selective deactivation : Disable Gutenberg only for certain content types (post types), while keeping it active for others.
- Deactivating frontend styles : Delete the Gutenberg CSS files on the frontend to lighten page loading.
- Restore classic widgets : Reactivate the classic widget screen if you're using a non-block-based theme.
- Intuitive interface : Configure your preferences easily via a sub-menu in the WPMasterToolKit dashboard.
How do I use the Disable Gutenberg module?
- Activate the : In the WPMasterToolKit dashboard, activate the module Disable Gutenberg.
- Configure preferences :
- Go to the "Disable Gutenberg" submenu in the WPMasterToolKit settings.
- Check the post types for which you wish to disable Gutenberg.
- Enable or disable frontend style deletion to optimize performance.
- Enable or disable the use of classic widgets.
- Save your settings : Click on "Save" to apply your changes.
- Enjoy control : Gutenberg will be disabled according to your preferences, and the specified content types will use the classic editor.
Use cases
- Retroactive compatibility : Use the classic editor for older projects not optimized for Gutenberg.
- Optimized performance : Remove unnecessary CSS styles generated by Gutenberg on the frontend.
- Simplified management : Reactivate classic widgets for more intuitive dashboard management.
Technical documentation: the hooks used
The module uses native WordPress hooks to seamlessly manage Gutenberg deactivation:
- Filter
use_block_editor_for_post
This filter allows you to disable the block editor for specific types of content.
Example:add_filter( 'use_block_editor_for_post', array( $this, 'disable_gutenberg_admin' ), 10, 2 );
- Action
wp_enqueue_scripts
Used to disable Gutenberg-related CSS files on the frontend.
Example:add_action( 'wp_enqueue_scripts', array( $this, 'disable_gutenberg_front' ), 100 );
- Filters
gutenberg_use_widgets_block_editor
anduse_widgets_block_editor
These filters disable the block editor for widgets and restore the classic management screen.
Example:add_filter( 'gutenberg_use_widgets_block_editor', array( $this, 'disable_gutenberg_widgets' ) );
Our technical choices
- Selectivity : The module lets you deactivate Gutenberg only where it's not needed, ensuring a smooth transition for existing projects.
- Performance optimization : Removing unnecessary frontend styles makes your pages lighter and loads faster.
- Easy to use : An intuitive interface makes management accessible even to non-technical users.
Conclusion
The module Disable Gutenberg from WPMasterToolKit is an indispensable tool for administrators and developers wishing to maintain control over the WordPress editor. Whether it's to maintain compatibility, improve performance or simplify the user experience, this module gives you the flexibility to manage Gutenberg according to your needs. Try it today for optimal customization of your WordPress site!