Remove element type for richTexy

default discord avatar
akacronoslast year

I want to remove de code button from a richtext field, i don't add it in my


is there a way to remove it?

  • discord user avatar
    last year

    Hi @akacronos, what you're doing is correct however


    is not an element it is a leaf. You can see which options are elements vs leaves here:

    So if you add the leaves property and don't include 'code' then this option will be hidden.

          name: 'content',
          type: 'richText',
          admin: {
            leaves: [

    For example this would just show bold and italic - or if you had an empty array here none would show.

  • default discord avatar
    akacronoslast year

    Oh, thanks!

Star on GitHub


Chat on Discord



Can't find what you're looking for?

Get help straight from the Payload team with an Enterprise License.