TinyMCE 4 - remove() or destroy()

You need an editor id (which usually equals your editor html root elements id (in most cases a textarea)).

Example:

tinymce.execCommand('mceRemoveControl', true, 'my_original_textarea_id');

I had the same problem. In v4 all suggestions above did not work for me, but this did:

tinymce.remove("div.editable");

... regenerated HTML dynamicaly ...

tinymce.init(...);

I use inline editor:

tinymce.init({
    selector: "div.editable",
    inline: true,
    plugins: [
    "advlist autolink lists link image charmap print preview anchor",
    "searchreplace visualblocks code fullscreen",
    "insertdatetime media table contextmenu paste"
    ],
    menubar: false,
    toolbar: "insertfile undo redo | styleselect | bold italic | alignleft aligncenter alignright alignjustify | bullist numlist outdent indent | link image"});

Hope this helped


Just in case anybody arrived here who is using the jQuery version of TinyMce use the following instead to remove an instance:

$("#textarea_id").tinymce().remove();

Tags:

Jquery

Tinymce