How to disable the Code Editor in Gutenberg?
While there already are similar questions around this topic I have yet to find anything about disabling the Code editor in Gutenberg permanently, for all users:
Using Gutenberg is a must, so I’m not looking for solutions regarding the classic editor or alternative editor plugins.
A code snippet that disables the editor would be much welcomed (I don’t want to use a UI-only option). If this can’t be achieved through hooks in the backend, I would also accept solutions that only affect the front end (since the backend receives HTML regardless of the editor used). Using
display: none to hide the option would be one way to do it but I’d prefer a more permanent solution.
The main reason for this is for security. I have already disabled many blocks and the patterns.
I have already tried returning
wp_code_editor_settings but that did not do anything to the Gutenberg editor.
Leave an answer