Set Default Editor Mode (TinyMCE / HTML) in WordPress

I recently built a plugin where I needed WordPress to by default always set its editor to Text (HTML) mode and not tinyMCE.

This is achievable using the undocumented filer wp_default_editor.

To make TinyMCE always display by default, use the code below.


function set_default_editor() {
	$r = 'tinymce';
	return $r;
}
add_filter( 'wp_default_editor', 'set_default_editor' );

To make the text / HTML mode the default editor, change the $r to html like so


function set_default_editor() {
	$r = 'html';
	return $r;
}
add_filter( 'wp_default_editor', 'set_default_editor' );

Remain blessed.

Don’t miss out!
Subscribe to My Newsletter
Invalid email address