Contribute to this guideReport an issue

Removing Text Formatting Documentation

The text formatting cleanup functionality is provided through the Remove Format plugin which by default is available in the Standard and Full distributions.

When the plugin is enabled, the   button is automatically added to the toolbar. You can use it to remove any text formatting that is applied through inline HTML elements and CSS styles, like basic text styles (bold, italic, etc.), font family and size, text and background colors or styles applied through the Styles drop-down. Note that it does not change text formats applied at block level.

Since this feature applies to inline styles, you need to select the text fragment whose formatting is to be removed.

Related Features

Get Sample Source Code

  • Removing text formatting
    <!doctype html>
    <html lang="en">
    
    <head>
      <meta charset="utf-8">
      <meta name="robots" content="noindex, nofollow">
      <title>Removing text formatting</title>
      <script src="https://cdn.ckeditor.com/4.25.0-lts/standard-all/ckeditor.js"></script>
    </head>
    
    <body>
      <textarea cols="80" id="editor1" name="editor1" rows="10">&lt;p&gt;This is some &lt;strong&gt;sample text&lt;/strong&gt;. You are using &lt;a href=&quot;https://ckeditor.com/&quot;&gt;CKEditor&lt;/a&gt;.&lt;/p&gt;</textarea>
      <script>
        CKEDITOR.replace('editor1', {
          height: 250,
          // Adding Text and Background Color, Font Family and Size buttons to make sample
          // text styling more spectacular.
          extraPlugins: 'colorbutton,font',
          // By default, some basic text styles buttons are removed in the Standard preset.
          // The code below resets the default config.removeButtons setting.
          removeButtons: '',
          // Rearrange the toolbar slightly.
          toolbarGroups: [{
              name: 'clipboard',
              groups: ['clipboard', 'undo']
            },
            {
              name: 'editing',
              groups: ['find', 'selection', 'spellchecker']
            },
            {
              name: 'links'
            },
            {
              name: 'insert'
            },
            {
              name: 'forms'
            },
            {
              name: 'tools'
            },
            {
              name: 'document',
              groups: ['mode', 'document', 'doctools']
            },
            {
              name: 'colors'
            },
            {
              name: 'others'
            },
            {
              name: 'about'
            },
            '/',
            {
              name: 'basicstyles',
              groups: ['basicstyles', 'cleanup']
            },
            {
              name: 'paragraph',
              groups: ['list', 'indent', 'blocks', 'align', 'bidi']
            },
            {
              name: 'styles'
            }
          ],
          removeButtons: 'PasteFromWord'
        });
      </script>
    </body>
    
    </html>