Skip to content

Instantly share code, notes, and snippets.

@terryupton
Created March 22, 2025 10:34
Show Gist options
  • Save terryupton/34ffcbda9412bc5bd253dcdfaf431c36 to your computer and use it in GitHub Desktop.
Save terryupton/34ffcbda9412bc5bd253dcdfaf431c36 to your computer and use it in GitHub Desktop.
Adding character count to CKEditor in Craft CMS

The first-party WordCount plugin is already included in Craft’s CKEditor plugin. It can show word and/or character counts and include logic on what should happen as you type (e.g. when you get near or over the limit). If you toggle “Show word count” in the CKEditor field’s setting, you get the word count shown underneath the field. To turn on character count, go to CKEditor Config used by that field and add the following under “Config Options”:

"wordCount": {
    "displayCharacters": true,
    "displayWords": true
}

That configuration can then be further customised to meet your needs. More info on that here: https://ckeditor.com/docs/ckeditor5/latest/features/word-count.html.

We’ll discuss character limits internally.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment