Here we are discussing a situation when we are adding content to the wordpress pages or posts and we want to set the admin editor in “text” version.

Sometimes we need to put some html content to the posts and pages. In this case we need to put that content in text mode of the editor to view correct in browsers. But changing the mode of editor from “visual” to “text” every time kills a lot of our time.

To make it easier or fast we can set wordpress editor in way so that it always open up in text state. Just put the below mentioned code in your functions.php file of your current theme :


add_filter( 'wp_default_editor', create_function('', 'return "html";') );

After putting this code your editor in admin will open up like below image :

text

In this way we can save our valuable time of changing editor again and again. In the same way we can also set default wordpress admin editor as visual as per our choice.