I have a few posts where there are some code segments. When I try to make small edits in the post, it opens in the 'Visual' mode and all the non-alphanumeric characters (e.g. >) are converted to their html equivalents (e.g. >). Also I lose all the indentation. I would like to open all posts in the 'Text' mode by default. Is it possible to do that?

1 Answer 1


Add the following line to your theme's functions.php:

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

Use "html" to set the Text editor tab as default (as shown above), or "tinymce" to set the Visual editor tab as default.

  • Thank you for your answer. I am currently using the free blogging service. My blog has this address: thespeakingsonu.wordpress.com. Is it possible to edit functions.php here too?
    – Unos
    Jul 31, 2014 at 19:43
  • You won't be able to edit PHP files with a Wordpress.com hosted site; that's only possible with a self-hosted site. Last I checked, there was no option to set the Text editor as default with Wordpress.com.
    – Gabriel
    Jul 31, 2014 at 22:31

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.