Remove border radius setting from the Gutenberg button block?

I want to remove the border radius settings from button block so users can’t access it since I don’t want them getting confused on why it’s “not working” (I forced 0 radius in the css for now).

enter image description here

I’ve been able to additional settings with editor.BlockEdit but I’m still having problems trying to remove them from core blocks and I don’t see a way to target it with css to just hide them.

1 Answer
1

Create a theme.json file in the root of your theme, and add this inside:

{
  "version": 1,
  "settings": {
    "blocks": {
      "core/button": {
        "border": {
          "customRadius": false
        }
      }
    }
  }
}

It will only work from WordPress v5.8 and above, because it requires Gutenberg v10. However Gutenberg v10 can be installed as a plugin on older versions of WordPress too, in which case it works with older WordPress versions as well, such as the currently latest stable release v5.7.2 (which is based on Gutenberg v9 by default).

Leave a Comment