# 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.

- Type: PHP
- Runs: Admin only
- Category: [Disable Features](https://wpide.com/library/category/disable-features/)
- Tags: disable, classic-editor, html
- Author: WPIDE Team
- Installs: 0
- Updated: 2026-10-28
- Page: https://wpide.com/library/disable-visual-tab-classic-editor/

## Code

```php
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 use it

Install the free WPIDE plugin (https://wordpress.org/plugins/wpide/), find "Turn Off the Visual Tab in the Classic Editor" in its snippet library and add it in one click; or create a new PHP snippet in WPIDE (or any code snippets plugin) and paste the code above. More snippets: https://wpide.com/library/
