Contribute to this guideReport an issue

Custom Editor Toolbar Documentation

CKEditor 4 toolbar is highly flexible and can be easily adjusted to your needs. You can influence such toolbar aspects as:

  • The number of buttons available to your users.
  • How the available buttons are grouped.
  • The sequence of groups in the toolbar.
  • The sequence of buttons within a group.
  • The number of toolbar rows.
The most recommended approach to adjusting the editor to your needs is to start from creating a custom build, removing unwanted features before they even make it to your toolbar. It is a bad practice to download the Full package and then remove plugins or buttons in your configuration. You will only be loading unnecessary stuff without any good reason.

Toolbar Configuration

The simplest way to configure the toolbar is to use the dedicated toolbar configurator that is available in each editor installation package starting from CKEditor 4.5. The editor instance below was configured by using the accessible "toolbar groups" approach, with some unwanted buttons removed by setting the config.removeButtons configuration option.

When content filtering is working in automatic mode, toolbar configuration affects what is allowed in the editor. In other words, CKEditor 4 will only allow the type of content that can be created using the available toolbar buttons and will remove disallowed elements.

Related Features

Get Sample Source Code

  • Custom toolbar
    <!doctype html>
    <html lang="en">
    
    <head>
      <meta charset="utf-8">
      <meta name="robots" content="noindex, nofollow">
      <title>Custom toolbar</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', {
          // Define the toolbar groups as it is a more accessible solution.
          toolbarGroups: [{
              "name": "basicstyles",
              "groups": ["basicstyles"]
            },
            {
              "name": "links",
              "groups": ["links"]
            },
            {
              "name": "paragraph",
              "groups": ["list", "blocks"]
            },
            {
              "name": "document",
              "groups": ["mode"]
            },
            {
              "name": "insert",
              "groups": ["insert"]
            },
            {
              "name": "styles",
              "groups": ["styles"]
            },
            {
              "name": "about",
              "groups": ["about"]
            }
          ],
          // Remove the redundant buttons from toolbar groups defined above.
          removeButtons: 'Underline,Strike,Subscript,Superscript,Anchor,Styles,Specialchar,PasteFromWord'
        });
      </script>
    </body>
    
    </html>