Skip to:
Content
Pages
Categories
Search
Top
Bottom

Reply To: Remove or suppress rich text / TinyMCE ability in text areas

@mcuk

Participant

After a lot of searching I’ve put this together. It appears to remove the ability of normal site users to use the rich text area editor in ‘multi line text areas’. Its use now allows jQuery functions for character limits to be applied to the text area which was not possible when tinymce was active.

function bptest_remove_tinymce() {
	if ( !is_super_admin() ) {
	tinymce.activeEditor.getBody().setAttribute( 'contenteditable', false );
	}
}
add_action( 'wp_footer', 'bptest_remove_tinymce' );

Note that the is_super_admin() is included. Without it the WP bar at the top of the screen which is used to access dashboard etc disappears.

Then to remove the remaining Visual/Text tabs attached to the text area, use the CSS display:none on the relevant div id.

I am still very curious as to whether there are better methods for excluding the rich text editor / tinymce from Buddypress (across the site and/or targeting specific text areas). Would appreciate any input from anyone more in the know!

Thanks

Skip to toolbar