Solvedgutenberg Is it possible to disable default block styles?

Some blocks come with multiple styles. For example, a default Quote block offers two styles: Regular and Large. I am wondering, if it's possible to disable a specific style. add_theme_support() maybe?

14 Answers

✔️Accepted Answer

Removing works fine for me with the following example:

wp.domReady( () => {
	wp.blocks.unregisterBlockStyle( 'core/quote', 'default' );
	wp.blocks.unregisterBlockStyle( 'core/quote', 'large' );

	wp.blocks.unregisterBlockStyle( 'core/button', 'default' );
	wp.blocks.unregisterBlockStyle( 'core/button', 'outline' );
	wp.blocks.unregisterBlockStyle( 'core/button', 'squared' );
} );

This script is enqueued via wp_enqueue_script( 'gutenberg-testing', plugins_url( 'editor.js', __FILE__ ), array( 'wp-blocks', 'wp-dom' ), time(), true );

Can you provide an example plugin where it's not working?

Other Answers:

wp.blocks.unregisterBlockStyle has no effect on core blocks for me (WP 5.0 Beta 4/Gutenberg 4.3), at least when enqueued in a theme via 'init' or 'enqueue_block_editor_assets' like this:

add_action( 'enqueue_block_editor_assets', 'theme_name_block_editor_styles' );
 * Enqueues Gutenberg admin editor scripts.
 * @since 2.7.0
function theme_name_block_editor_styles() {

		get_stylesheet_directory_uri() . '/lib/gutenberg/js/editor.js',
		array( 'wp-blocks' ),


I had to use a filter in /lib/gutenberg/js/editor.js to filter block styles like this instead:

var yourTheme = (function () {
	'use strict';

	function adjustBlockStyles(settings, name) {
		switch (name) {
			case 'core/quote':
				return removeStyles(settings, ['large']);
			case 'core/button':
				setDefaultLabel(settings, 'Squared');
				return removeStyles(settings, ['outline', 'squared']);
			case 'core/pullquote':
				return removeStyles(settings, ['solid-color']);
			case 'core/separator':
				return removeStyles(settings, ['wide', 'dots']);
			case 'core/table':
				return removeStyles(settings, ['stripes']);
				return settings;

	function setDefaultLabel(settings, newLabel) {
		settings['styles'] = settings['styles'].map(function (style) {
			if (style.isDefault) style.label = newLabel;
			return style;

	function removeStyles(settings, styles) {
		settings['styles'] = settings['styles'].filter(function (style) {
			return styles.indexOf( === -1;
		return settings;

	return {
		adjustBlockStyles: adjustBlockStyles



You can add console.log(name, settings.styles); at the top of adjustBlockStyles before the switch statement to see a list of all active blocks and their available style names prior to being filtered.

Related Issues:

gutenberg Can't NPM Install: ENOENT: no such file or directory .staging/core-js-c2a9e69c (solved with rm -rf node_modules && npm install)
Delete package-lock.json and run npm install Hey @mintplugins which version of node and npm do you u...
gutenberg What is the proposed way to update blocks?
I am facing the same issue and absolutely agree with Fabian on this What if the frontend switches to...
gutenberg Are iframes a viable long-term solution for meta boxes?
Do all metaboxes have to work on mobile? Yes why wouldn't they? What are the cases (if any) that wou...
gutenberg Supporting Metaboxes
I also want to emphasize that many plugins use custom post types that rely on meta boxes without a c...
gutenberg Block API: Server-side awareness of block types
@aduth thanks for creating this ticket and CCing me! there is still a lack of general understanding ...
gutenberg Immediate crash of editor upon opening new post page (solved by updating nginx config)
Fixed tldr: if you run Nginx you might need to update your nginx config I have the same problem With...
gutenberg Gutenberg breaks completely if site URL is not the same as wordpress URL
Here's what I did to make it work (I only have 1 site): Issue Overview I have wordpress installed on...
gutenberg The editor has encountered an unexpected error. (solved by updating the try_files nginx configuration)
Just to confirm the following worked for me: try_files $uri $uri/ /index.php$is_args$args; @Zenexer ...
gutenberg Block Transforms should be more discoverable/obvious
I'd like to propose an alternative as I think there is already an over-reliance on iconography in Gu...
gutenberg Can't style embedded videos properly due to inline width & height
Here's basic front-end css: You are welcome. Describe the bug There's numerous issues open that disc...
gutenberg Is it possible to disable default block styles?
Removing works fine for me with the following example: This script is enqueued via wp_enqueue_script...
gutenberg Introduce concept of block templates for full site editing
Since we already did some Full Site Editing work on I’ll try to convey some of the thi...
gutenberg Allow multiple InnerBlocks per block
Imagine something simple as this example... Currently InnerBlocks can only be rendered once into any...
gutenberg Event or callback after block loaded on editor
I was also looking for the same options but could not find any solutions anywhere It seems like no e...
gutenberg @wordpress/env: A zero-config, self contained local WordPress environment for development and testing.
We've iterated a lot on @wordpress/env these past few weeks and I think we're now at the point where...
gutenberg Classic + Custom HTML blocks: Convert to Blocks removes valid inline formatting
@ZebulanStanphill @danielbachhuber F.Y.I I tried some fix phrasingContentReducer for ruby tag Now it...
gutenberg Metaboxes overlap Gutenberg in Chrome 77
Confirmed that the CSS solution worked for us I dropped this into our theme, ~~ Added by @nerrad ~~ ...
gutenberg Improve behaviour when saving content while offline
It would indeed be a great improvement to show a warning when offline and to store the changes in lo...
gutenberg How to replace the Document Settings panels or controls?
@jonathanstegall The removeEditorPanel() method only supports the removal of 5 built-in meta boxes: ...
gutenberg Support for Responsive Columns
Just adding my 2 cents.. In my own theme I simply add a media query and then set each column (.wp-bl...
gutenberg How to add blocks is not obvious enough and only getting worse.
Please I'm submitting this issue because I think that issue #5074 doesn't quite go far enough in out...
gutenberg My Parent Pages Are Still Missing In Gutenberg
I started work on implementing an accessible-autocomplete for sites with a large number of pages in ...
gutenberg How to server render block with nested blocks?
Hey sorry all for the delay but it is possible to have an InnerBlocks and render your block on the s...
gutenberg Dynamic reusable blocks: technical details
I might be missing a piece of this puzzle so apologies for wading into this late! The above REST spe...
ddev In WSL2 ddev start fails at docker-credential-desktop.exe, "error listing credentials"
I had to set credsStore: in my ~/.docker/config.json .. it was previously set to credentials.exe ...
woocommerce The Header Mini Cart does not update after a product is removed
Here is my fix EXPLANATION OF THE ISSUE After removing a product on the Shopping cart page /cart/ ...
FoundationPress Missing modules when running npm run build or npm install
The error in the original post is from running npm run build Hi I am working on a foundation press p...
woocommerce Rethinking 3.6's Dashboard Ads (#22857 )
​It appears what you're doing here is tracking usage reporting that back to your API and returning t...
FoundationPress After Node update, Issue running npm run production
Try this: npm uninstall gulp --save Then once that is complete run: npm install then: npm run build ...
lando Unhandled rejection Error: problem parsing null.tooling.cache. Ensure it is valid JSON!
Hi I had the same issue just now and apparently I only missed adding the name on my .lando.yml file ...
wp graphql Get Single Nodes (posts, terms, users, etc) by more than ID
The next release I'm working on (#1086) addresses this (the ability to fetch single nodes by various...
lando lando does not start
On ubuntu 16.04 docker rm landoproxyhyperion5000gandalfedition_proxy_1 helped me to ged rid of this ...
sage Sage 9.0.10 - postcss.config.js not working
To anyone else hung up on this I found a workaround My version of this issue was not font related bu...
woocommerce Negative amount as fee and tax calculation in checkout
If someone is still looking for an answer here is mine It works like a charm Describe the bug I have...
wp calypso Editor: Permission Errors when trying to Update/Publish Post/Pages
The fix has been deployed today to wpcom as D57128 after the first attempt had to be reverted due to...
lando Permissions issue with Docker
I also ran into this on: macOS 11.1 (Big Sur) Lando v3.0.25 I fixed with sudo chown -R username /Use...
acf to rest api How to get ACF post object field with ACF fields
Hi @travis-zookacreative Thanks for using my plugin bellow I wrote an example most generic V3 V2 Fun...
lando Unable to 'lando pull' pantheon site
This worked for me: lando terminus auth:login --machine-token=ABCDEFGHIJKLMNOPQRSTUVQXYZ (don't stea...
lando Please add Docs for Drupal's "Drush" CLI Command Debugging via XDebug
This is what worked for me: Then turning on Listen for PHP Debug Connections in PHPStorm and calling...
lando mysql stop connecting after lando restart
I think I found a solution I had same issue multiple times and I was forced to completely uninstall ...
woocommerce Attributes lost all parents
Hi @ABCPortugal like Claudio wrote you need to use the filter woocommerce_taxonomy_args_{$name} for ...
lando Support Xdebug 3
This worked for me PHPStorm 2020.3 drupal9 Xdebug 3 is out and comes with a lot of performance optim...
wp graphql How to create query/mutation for custom table in WP
WPGraphQL can work with any data source It's optimized to work with WordPress core data (Posts Terms...
woocommerce PayPal Intermittent Transaction cancelled or Internal server error on guest checkout
Thanks @mikejolley EXPLANATION OF THE ISSUE Using WooCommerce 3.0.5 and guest checkout ...
woocommerce product slider not working for rtl on woocommerce update
all you need to do is just set direction for gallery wrapper to rtl EXPLANATION OF THE ISSUE I updat...
jetpack Jetpack JSON API access crashes PHP-FPM running PHP 7.1
The Jetpack people noticed me about the freshly baked 5.3 update today:
acf to rest api Apply same post format as WP JSON if ACF return format is Post Object
Allright thanks! The ticket on core is picked up and it will be fixed in WP 4.9.5 For the people who...
ddev Create a service configuration for varnish
Hi this is how we are doing this at wegewerk: What happened (or feature request): Edit: @stborchert ...
wp calypso Calypso: Deep links redirecting
This is a real bug and it's probably been around for some time Not a recent regression ...