I want to remove de code button from a richtext field, i don't add it in my
admin:elements[]
is there a way to remove it?
Hi @akacronos, what you're doing is correct however
code
is not an element it is a leaf. You can see which options are elements vs leaves here:
https://payloadcms.com/docs/fields/rich-text#admin-configSo if you add the leaves property and don't include 'code' then this option will be hidden.
{
name: 'content',
type: 'richText',
admin: {
leaves: [
'bold',
'italic'
],
}
},
For example this would just show bold and italic - or if you had an empty array here none would show.
Oh, thanks!
Star
Discord
online
Get help straight from the Payload team with an Enterprise License.