'Disable WP Gutenberg prepublish checks globaly

Im creating custom user edit post interface and i need to completely remove gutenberg pos prepublish checks and publish. How can i do this?



Solution 1:[1]

You can disable the publish sidebar completly with

wp.data.dispatch('core/editor').disablePublishSidebar();

Simply enqueue this JS with a dependance to .

add_action( 'enqueue_block_editor_assets', function () {
  wp_enqueue_script( 'so69031961', 'gutenberg-editor.js', [ 'wp-edit-post', 'wp-dom-ready' ] );
} );

This will have the same effect than unchecking this box :

disable the prepublish checks sidebar

So yes, your users might still be able to reactivate the checks, but it's better than nothing ;)

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1