How to Disable Custom Colors in Gutenberg

Hat tip to Felix Arntz for introducing us to this simple trick.

Gutenberg disable custom color wheel
Remove the custom color wheel from Gutenberg block options

I first learned about this from Felix's tweet, but have since confirmed it via the official Gutenberg documentation on wordpress.org.

"By default, the color palette offered to blocks, allows the user to select a custom color different from the editor or theme default colors. Themes can disable this feature using:"

add_theme_support( 'disable-custom-colors' );

Simply add this line to the functions.php of your theme to prevent clients from going rogue on your predetermined color scheme.

This flag will make sure users are only able to choose colors from the editor-color-palette the theme provided or from the editor default colors if the theme did not provide one.

Speaking of the editor-color-palette...

How to create a custom color palette 👉🏼

Leave a Comment