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 4 replies - 1 through 4 (of 4 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.

    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.

    landt

    (@landt)

    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?

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