• Page and Post editor is set to the default, Visual mode in my WordPress site. However, I would like to force a few specific Pages to always be in Text view?

    Is this possible?

Viewing 2 replies - 1 through 2 (of 2 total)
  • Moderator keesiemeijer

    (@keesiemeijer)

    Try it with this in your theme’s functions.php:

    add_filter( 'user_can_richedit', 'disable_my_richedit' );
    function disable_my_richedit( $default ) {
        global $post;
        if ( $post->ID == 32 ) // change the post ID
            return false;
        return $default;
    }

    If you need it for more than one post (page) id try this:

    add_filter( 'user_can_richedit', 'disable_my_richedit' );
    function disable_my_richedit( $default ) {
        global $post;
        if ( in_array( $post->ID, array(32,33) ) ) // change the post ID
            return false;
        return $default;
    }

    Thread Starter Sridhar Katakam

    (@srikat)

    Thank you.

    That worked.

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘How to make specific entries always use Text mode and not default Visual mode?’ is closed to new replies.