When we are working in wordpress admin, generally we face this issue while adding posts and pages on regular basis. We find that our editor in which we are placing the content for any post or page opens up with its html/text version.

It is quite irritating us to change it to “visual” and then write content every time. So to solve this issue we just need to copy and paste below mentioned code in our functions.php file of current theme as follows :


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

After putting this small code snippet, whenever we open our wordpress admin the editor will open in “visual” state. Now the editor looks like below image :

visual

 

A single line of code will save our precious time which we are wasting in changing editor on each step, In same manner we can also set wordpress admin editor to html state by a minor change in above mentioned code.