Support » Developing with WordPress » Gutenberg Headings Block … Remove H1, H3, etc as Options

  • Resolved Kelderic

    (@kelderic)


    Hi there,

    How do I filter the options for the Heading block? I only want to allow H2s, which I current accomplish with TinyMCE. In fact, in a perfect world, I’d combine the paragraph and heading block and just give users the option of body text or heading, and don’t use the term “H2” at all.

    Thanks!

Viewing 9 replies - 1 through 9 (of 9 total)
  • Moderator Tellyworth

    (@tellyworth)

    This is not as trivial as I might have hoped. I can think of two basic ways:

    1. Use block filters to alter the behaviour of the core/heading block, overriding the HeadingToolbar components.

    2. Use CSS to style all headings so that they look the same.

    Obviously there are pros and cons to both, choosing the appropriate one depends on context.

    Kelderic

    (@kelderic)

    Thanks for the suggestions!

    I’m going to look into 1, or into creating my own custom Heading block. Option 2 isn’t really an answer, because it’s completely unsemantic.

    Hey there @kelderic did you manage to solve this? I’m able to allow only certains parts of the core/ block but I don’t know how to disable h1, h2 and h3 while keeping h4, h5 and h6 on default Post editor.

    I have the same issue. I am able to add and edit content on the core/heading block, but I have a hard time figuring out how to only allow H3, H4, H5 and H6 elements rather then all 6 of them. @kelderic how did you manage to solve this?

    timotheemoulin

    (@timotheemoulin)

    Hi @kelderic
    As you managed to work it out, that would be great if you could share your solution with us.

    Cheers,
    tim

    I’m curious how this was marked resolved when a confirmed solution doesn’t seem to be present?

    timotheemoulin

    (@timotheemoulin)

    I personally ended up disabling the core/heading block and created a new one with a RichText component so I can style it.

    I’d really rather have a way to filter the core block instead of having to come up with a custom block.

    This is marked as resolved but it’s not.

Viewing 9 replies - 1 through 9 (of 9 total)
  • You must be logged in to reply to this topic.