
WordPress offers two editing modes in the Classic Editor: the Visual Editor (TinyMCE) and the HTML Editor (Text mode). By default, WordPress opens the editor you last used, but you can set a specific editor to load by default every time. You can choose either the HTML Editor or the Visual Editor by using a simple function in your theme's functions.php file.
How to Set HTML Editor as the Default
If you prefer to write in plain HTML (Text mode), add this code to your theme's functions.php file:
// Set HTML Editor as the default in Classic Editor
add_filter( 'wp_default_editor', function() {
return 'html';
});
How to Set Visual Editor as the Default
If you prefer the Visual (WYSIWYG) Editor, use the following code instead:
// Set Visual Editor as the default in Classic Editor
add_filter( 'wp_default_editor', function() {
return 'tinymce';
});
Important: This tutorial is intended for websites using the Classic Editor. If you are using the default Block Editor (Gutenberg), these filters won't apply. You'll need to install the Classic Editor plugin and enable it for these settings to take effect.