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.

If I run this code then I no longer get the toolbar but I still get a word count and visual/html tabs and when I save the post my content gets wrapped in <\p> tags.

jQuery(document).ready(function() {
    jQuery('#content').removeClass('theEditor').addClass('mceNoEditor');

    tinyMCE.init({
      mode: "none",
      editor_deselector : "mceNoEditor"      
    });

What is the correct way to keep a textarea and not let tinymce override it?

share|improve this question

2 Answers 2

You can remove the wp-autop function which WordPress uses to format the output of the WYSIWYG editor. It will stop tinymce from adding additional p tags, but will require you to add correct formatting (because you're removing the wp-autop the output won't be altered. This if you use the visual editor and it doesn't convert the visual input to valid HTML tinymce will no longer attempt to correct it).

If you still want to try, here is the code to add to your functions.php file:

<?php remove_filter ('the_content', 'wpautop'); ?>
share|improve this answer

This should work:

add_filter( 'user_can_richedit', 'wpse24935_remove_richedit', 99 );
function wpse24935_remove_richedit( $bool ){
     return $false;
}
share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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