Gutenberg Components - "I only need one"
Gutenberg comes with an awful lot of default components (see list below) most of which will never be used in our websites.
It's perfectly possible to just leave them there but this has the potential for disaster.
Leaving them visible to the content manager raises two possibilities;
- It will be difficult for them to find the actual component they want to use
- They will try to use a component that we haven't styled which will break the layout on the frontend
So, what do we do...?
Only show the components you will actually use
Drop this into your
functions.php file or, better yet, write a plugin to handle it 😎
add_filter('allowed_block_types', 'txb_allowed_block_types', 10, 2);
function txb_allowed_block_types( $allowed_blocks, $post )
$allowed_blocks = array(
'core/image', // Add the blocks you want here...
'acf/videum' // Add your custom blocks here
Gutenberg Default Components
- Classic Block
- Custom HTML
- Media & Text
- Page Break
- Latest Comments
- Latest Posts
- Funny or Die
- Speaker Deck
Real. Simple. Syndication.
Get my latest content in your favorite RSS reader.
I use InoReader but you don't have to.
In almost all cases, the comments section is a vile cesspool of Reply Guys, racists, and bots.
I don't want to have to deal with that kind of hell so I don't have a comments section.
If you want to continue the conversation, you can always hit me up on Mastodon (which is not a vile cesspool of Reply Guys, racists, and bots).