Disable Code Editor

PublishPress Capabilities allows you to remove the “Code editor” option for Gutenberg users. This will prevent users from accessing the HTML view of posts that they are editing.

The Code editor is available using the 3 dots icon in the top-right corner of the Gutenberg editor, as shown in the image below:

Code Editor
Code Editor

The Code editor is also available for individual blocks using the “Edit as HTML” option that's shown below.

Code Editor Block
Code Editor Block

Here are the steps to take to disable the Code editor for a user role:

  • Go to the “Roles” screen.
  • Edit a user role.
  • Click the “Editing” tab.
  • You can now choose to disable the “Code editor” for this role.
Force Editor