Remove Gutenberg blocks
Add the following code to only allow some Gutenberg blocks to your WordPress site.
add_filter('allowed_block_types', 'setAllowedBlocks');
function setAllowedBlocks($allowed_blocks) {
$allowed_blocks = array(
'core/image',
'core/paragraph',
'core/heading',
'core/list'
);
return $allowed_blocks;
}
Full list of all available blocks with the categories text, media, design, widgets and embeds:
- core/paragraph
- core/heading
- core/list
- core/quote
- core/code
- core/freeform
- core/preformatted
- core/pullquote
- core/table
- core/verse
- core/image
- core/gallery
- core/audio
- core/cover
- core/file
- core/media-text
- core/video
- core/buttons
- core/columns
- core/group
- core/text-columns
- core/more
- core/nextpage
- core/separator
- core/spacer
- core/shortcode
- core/archives
- core/calendar
- core/categories
- core/html
- core/latest-comments
- core/latest-posts
- core/rss
- core/social-links
- core/tag-cloud
- core/search
- core/embed