DISCLAIMER: this post is older than one year and may not be up to date with latest WordPress version.

In WordPress dashboard, the default editor is the “Visual Editor”. It is probably the editor that most people enjoy, but personally I prefer using the HTML editor. If you’re like me you’ll probably like this tip which will make the HTML editor as the default.

Simply paste the following code on your functions.php file, save it, and you’re done!

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

Credit: WP Snippets.



  1. You shouldn’t really use “create_function()” in PHP. Better to do:

    add_filter( ‘wp_default_editor’, function(){ return ‘html’; } );


  2. Colin, I tried using what you used but it broke my wordpress installation. I got the error:

    Parse error: syntax error, unexpected T_FUNCTION in /home/electroj/public_html/wp-content/themes/arthemia/functions.php on line 12

  3. @ Jordan, I didn’t have any such problem with Colin’s code or Jean’s. Both worked fine, but I believe Colin’s is more inline with WP guidelines. What code is on and around line 19 of your theme’s functions.php?

  4. Is it possible to configure this? For example, “Visual” for posts and “HTML” for pages.
    Thank you.

  5. Could you provide a way to default to the full screen mode?

  6. Colin’s code breaks my wordpress installation.

  7. Collins code breaks your installation because you need to stop to copy and paste, and instead read what you copy before hand.

    The code provided by collins works perfect the problem is that this blogs replaces single quotes ( ‘ ) with something similar to single quotes ( ’ ) accents !!.

    So before complaint … Oh that code don’t works…. PLEASE READ WHAT YOU COPY !

Leave a Comment

Your email address will not be published. Required fields are marked *