Take the 2-minute tour ×
WordPress Development Stack Exchange is a question and answer site for WordPress developers and administrators. It's 100% free, no registration required.

Anyone know of the plugin that lets you selectively turn off the RTE, on a per-page or posts basis?

share|improve this question

closed as off-topic by G. M., birgire, ialocin, kaiser Aug 4 at 14:28

This question appears to be off-topic. The users who voted to close gave this specific reason:

If this question can be reworded to fit the rules in the help center, please edit the question.

1 Answer 1

Off the top of my head, I don't know of a plugin ... but it's easy enough to do this with a filter in your functions.php file (or in a custom plugin.

This code, for example, turns off the rich text editor for everything with the post type "presentation":

add_filter( 'user_can_richedit', 'disable_for_cpt' );
function disable_for_cpt( $allowed ) {
    global $post;
    if ( 'presentation' == get_post_type( $post ) ) {
        $allowed = false;
    }
    return $allowed;
}

You could do whatever checks you need in this filter. Check if the post/page has a certain ID or a certain slug. Or even check if it's in a specific category:

global $post;
if ( in_category( 'no_rte', $post ) ) {
    // ...

Really, the sky's the limit.

share|improve this answer

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