Gutenberg: Disable/hide blocks?

Created on 18 Jan 2018  ·  19Comments  ·  Source: WordPress/gutenberg

This came up when I was thinking about the title "block."
Often I want to hide the title from the front view. One way would be to add a disable/hide checkbox option inside the block setting. Hiding the title and perhaps hiding other blocks. Greying out the title to show that it is hidden/disabled.

Most helpful comment

I agree with jfagreg. The majority of webpages don't have a massive title at the top of the page. Look at how many portfolio-style or simply imaged based themes there are. Would they really want to suddenly have a bulking, unsightly title at the top?
It makes sense for posts to have titles, but not pages.

All 19 comments

You can extend blocks and set a block's isPrivate property to false or you can use of the different mechanisms to hide the blocks. https://wordpress.org/gutenberg/handbook/extensibility/#removing-blocks

Closing, let me know if it doesn't answer your question.

I was actually thinking more toward the user. For instance how to easily hide the title block because the user does not want it visible on the frontend. Or hiding other blocks the user wants to hide...

For instance testing out versions of a layout by hiding specific blocks to create another layout. Showing it to the customer and then modifying things along the way by clicking a checkbox to make blocks visible/non visible.

Having it open through the Gutenberg interface.

I'm not certain this is something we want to allow the users to do. It will add unnecessary options/toggles to the interface IMO. But deferring to our designers for input @jasmussen @karmatosed

I see what you mean...
We can just let it rest for now until we can think of additional use cases.

I agree with you @youknowriad.

Hi guys,
reading the comments I think this is the right place to share a good plugin about Gutenberg.
I would like to present you a free plugin that allows you to manage the Gutenberg editor.
It's called Gutenberg Manager and allows you to enable / disable the editor in the various post types (pages and posts included). It has more features but I leave them to you.

We have read tons of posts of people complaining about the future implementation of Gutenberg within the core in WP 5.0 and this has led us to find a simple solution.

Gutenberg Manager solves this problem and allows for example to continue using Elementor, Visual Composer, Siteorigin Builder or Cornerstone without any problem even after WP 5.0.
From the first user feedback on WP.org the plugin seems to be apreciated :)

For this reason I would like to introduce you to Gutenberg Manager -> https://wordpress.org/plugins/manager-for-gutenberg/

The plugin can be used by developers in their own themes and plugins thanks to some useful hooks. There is an hook to HIDE the plugin option panel so the final user will not see it in WP backend (great feature for the devs that want to include Gutenberg Manager in their projects).

We are also making arrangements with the teams of most famous Builders to activate partnerships and collaborations. In this way we hope to make the transition to Gutenberg a little less traumatic!

Thank you all for your attention,
Good job.

That seems like a great plugin! I hope it will be popular 👍

Thank you @jasmussen, we hope too!

The plugin offers a lot of great features!

screen shot 2018-03-08 at 17 54 46

Thank you @paaljoachim ! We will try to support and improve our Plugin after WP 5.. It will be hard to do because we are reading about many changes in the code respect the actual Gutenberg Plugin.. But we know we can do it!

We hope Gutenberg Manager can become a must!

Cheers

Am I missing something? It seems to me that it is necessary to be able to hide the title. Most homepages built with a page builder do not show the title of the page. I think this is the normal use case for a home page that is not an archive page, and not the exception. For example, I'm trying to build my now Beaver Builder home page with Gutenberg, and I have to resort to custom CSS to hide the title. Not good.

I agree with jfagreg. The majority of webpages don't have a massive title at the top of the page. Look at how many portfolio-style or simply imaged based themes there are. Would they really want to suddenly have a bulking, unsightly title at the top?
It makes sense for posts to have titles, but not pages.

Found this thread whilst searching to find out how to hide the title block...
E.g: I'm editing a simple "start here" page, and definitely don't want a great big, 'start here' at the top.

Blocks is the WORST idea ever. I wish I had never "updated" my wordpress site. I am a teacher with a blog who teaches writing to university students. Blocks is not conducive to the writing process AT ALL. I'm guessing that the developer who came up with this idea has never taken a writing class or any course that requires writing and critical thinking.
So now I'm wasting the time that I could be spending on making content for my blog (time which is limited to the short nap that my kid takes) trying to figure out how to get rid of this hideous "improvement." If anyone can help me with that, I'd be grateful.

I think this is ultimately needed, especially for page building. I don't want “Home Page” or “Home” rendered on my home page.

I understand the usecase, and I think that there are use cases for it. I think the key, though, is how we implement this, and in that vein I agree with Riad and Tammie that a specific "toggle" implemented across all blocks does not seem like the best solution.

Let's break it up, though — the example mentioned is the Title. I think this one deserves separate treatment and therefore separate ticket (and I could swear that there was already a ticket about this). The title should probably simply be a block on its own. That way you can simply delete it if you like — or you can put it elsewhere, for example someone might want to insert a Cover image, and then insert the Title block inside.

The challenge there, and why it's not part of phase 1, is that so far the title element has served double-duty as both in-page/post title and _title metadata_ (i.e. browser tab title). If a user can delete the title block, how can they then change the metadata title? The answer to that can likely inform improvements to the permalink design also; perhaps it is simply customizable from the sidebar and pre-publish experience. If an existing ticket for the title block does not exist, feel free to open one!

For other blocks this is a separate challenge that would also be good to look at separately. There is a use case for showing and hiding blocks at various responsive breakpoints. There is a use case for including or not including blocks as part of the archive view (excerpt). If looked at holistically, I imagine there's an elegant solution to be found to both of those. Are there other use cases for hiding blocks that aren't the title?

Oh, and @lalablog you can install the Classic Editor plugin.

Let's break it up, though — the example mentioned is the Title. I think this one deserves separate treatment and therefore separate ticket (and I could swear that there was already a ticket about this).

I agree on breaking this one out. Looks like there's a ticket here: #11553

Thinking title block vs other blocks.

Title block: Can not be deleted must be a part of the layout. Always starts up on the top of the backend. It can be moved around different locations or on top of a cover image/nested.
I made an issue for an option inside the contextual block menu to hide a block (linked just above here). This means one goes to the contextual menu and just hides the block from being seen on the frontend. Hide block becomes just an option that can be used for any block including the title block.

Bottom line is that the title block would be very similar to any other block with just one difference it can not be deleted. It can be hidden like any other block. Moved around in the layout like any other block.

The plugin offers a lot of great features!

screen shot 2018-03-08 at 17 54 46

Hello paaljoachim,

we are happy to share that we updated the plugin to work with WP5.x

Thank you for your feedback!

Best Regards

Was this page helpful?
0 / 5 - 0 ratings