Skip to content
A jumble of foam numbers

Gutenberg Components - "I only need one"

Friday, April 12, 2019

At 262 words, this article should take about 1 minute to read.

This article is more than a year old and the information in it may be out of date.

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;

  1. It will be difficult for them to find the actual component they want to use
  2. 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...
      'core/paragraph',
      'core/heading',
      'acf/videum' // Add your custom blocks here
    );

    return $allowed_blocks;

}

Gutenberg Default Components

  • Paragraph
  • Heading
  • Image
  • List
  • Quote
  • Gallery
  • Audio
  • Cover
  • File
  • Video
  • Code
  • Preformatted
  • Classic Block
  • Custom HTML
  • Pullquote
  • Table
  • Verse
  • Columns
  • Separator
  • Button
  • Media & Text
  • More
  • Page Break
  • Spacer
  • Shortcode
  • Archives
  • Categories
  • Latest Comments
  • Latest Posts
  • Embed
  • Twitter
  • YouTube
  • Facebook
  • Instagram
  • WordPress
  • SoundCloud
  • Spotify
  • Flickr
  • Vimeo
  • Animoto
  • Cloudup
  • CollegeHumor
  • Crowdsignal
  • Dailymotion
  • Funny or Die
  • Hulu
  • Imgur
  • Issuu
  • Kickstarter
  • Meetup.com
  • Mixcloud
  • Photobucket
  • Reddit
  • ReverbNation
  • Screencast
  • Scribd
  • Slideshare
  • SmugMug
  • Speaker Deck
  • TED
  • Tumblr
  • VideoPress
  • WordPress.tv

Comments

In almost all cases, the comments section is a 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 Twitter (which is, in it's own way, a vile cesspool of Reply Guys, racists, and bots).

Thomas Banks

Thomas Banks

When I'm not building things for the internet, I take photos of stuff.
Loading Invisible Visible Navigation Close Arrow Info Online Online