SaaS CMS has officially launched! Learn more now.

TinyMCE, Clear formatting


My client wants "everything" (for instance h1, h2,h3 etc.) to be unformatted when clicking on "Clear formatting" in TinyMCE (v. 2.6.5).

i'm trying to do like this:

var removeformats = @"{
formats: {
removeformat: [
selector: 'b,strong,em,i,font,u,strike,sub,sup,dfn,code,samp,kbd,var,cite,mark,q,del,ins,h1,h2,h3,h4,h5,h6',
remove: 'all',
split: true,
block_expand: true,
expand: false,
deep: true
{ selector: 'span', attributes: ['style', 'class'], remove: 'empty', split: true, expand: false, deep: true },
{ selector: '*', attributes: ['style', 'class'], split: false, expand: false, deep: true }


But nothing changes. "Clear formatting" is still functioning as "default".

I have succeded with simpler things like var pasteOptions = "{paste_as_text: false}" ;

So i thought this would work too...


Edited, Feb 20, 2019 17:58

Hi Linus,

Took a bit of trial and error, but the following works for me:

var formats = new
    removeformat = new object[]
            selector =
            remove = "all", split = true, expand = "false", block_expand = true, deep = true

config.Default().AddSetting("formats", formats).AppendToolbar("removeformat");
Mar 01, 2019 2:03

Thank you so much!

Mar 05, 2019 7:46
This topic was created over six months ago and has been resolved. If you have a similar question, please create a new topic and refer to this one.
* You are NOT allowed to include any hyperlinks in the post because your account hasn't associated to your company. User profile should be updated.