Turn Off the Visual Tab in the Classic Editor
Makes the classic editor open in Text (HTML) mode only, for sites where the visual editor keeps changing hand-written markup.
Opens WPIDE on
Code
add_filter( 'user_can_richedit', function ( $can ) {
$screen = function_exists( 'get_current_screen' ) ? get_current_screen() : null;
if ( $screen && method_exists( $screen, 'is_block_editor' ) && $screen->is_block_editor() ) {
return $can; // Leave the block editor alone.
}
return false;
} );
Notes
Only affects the classic editor; the block editor is unchanged.
How to add this snippet
- Install WPIDE on your WordPress site (it is free) and open Code Snippets.
- Use snippet above adds it from the library in one click. Or copy the code into a new snippet with the same code type.
- It is added inactive: review the code and settings, then switch it on.